ObjectStoreClient

uk.gov.hmrc.objectstore.client.ObjectStoreClient
class ObjectStoreClient[F[_], REQ_BODY, RES, RES_BODY](client: HttpClient[F, REQ_BODY, RES], read: ObjectStoreRead[F, RES, RES_BODY], write: ObjectStoreWrite[F, REQ_BODY], config: ObjectStoreClientConfig)(implicit F: Monad[F])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def deleteObject(path: File, owner: String)(implicit hc: HeaderCarrier): F[Unit]

Delete object

Delete object

Value parameters

owner

Owner service of this object

path

Path of the object in object-store under owner

Attributes

Returns

Unit wrapped in the effect F

def getObject[CONTENT](path: File, owner: String)(implicit cr: ObjectStoreContentRead[F, RES_BODY, CONTENT], hc: HeaderCarrier): F[Option[Object[CONTENT]]]

Get object

Get object

Type parameters

CONTENT

@see https://github.com/hmrc/object-store-client#get-object

Value parameters

owner

Owner service of this object

path

Path of the object in object-store under owner

Attributes

Returns

optional Object[CONTENT] wrapped in the effect F

def listObjects(path: Directory, owner: String)(implicit hc: HeaderCarrier): F[ObjectListing]

List objects

List objects

Value parameters

owner

Owner service

path

Path of the object in object-store under owner

Attributes

Returns

ObjectSummary wrapped in the effect F

def presignedDownloadUrl(path: File, owner: String)(implicit hc: HeaderCarrier): F[PresignedDownloadUrl]

Get a presigned download URL for an object

Get a presigned download URL for an object

Value parameters

owner

Owner service of this object

path

Path of the object in object-store under owner

Attributes

Returns

PresignedDownloadUrl wrapped in the effect F

Note

The downloadUrl has an expiration of 15 minutes.

def putObject[CONTENT](path: File, content: CONTENT, retentionPeriod: RetentionPeriod, contentType: Option[String], contentMd5: Option[Md5Hash], owner: String)(implicit w: ObjectStoreContentWrite[F, CONTENT, REQ_BODY], hc: HeaderCarrier): F[ObjectSummaryWithMd5]

Put object

Put object

Type parameters

CONTENT

@see https://github.com/hmrc/object-store-client#put-object

Value parameters

content

Content to upload

contentMd5

Optional MD5 hash of content

contentType

Optional Content-Type

owner

Owner service of this object

path

Path of the object in object-store under owner

retentionPeriod

Retention period of the object in object-store

Attributes

Returns

ObjectSummaryWithMd5 wrapped in the effect F

Note

Storing an object on an existing path will overwrite the previously stored object on that path.

def uploadFromUrl(from: URL, to: File, retentionPeriod: RetentionPeriod, contentType: Option[String], contentMd5: Option[Md5Hash], owner: String)(implicit hc: HeaderCarrier): F[ObjectSummaryWithMd5]

Upload object from a url

Upload object from a url

Value parameters

contentMd5

Optional MD5 hash of content

contentType

Optional Content-Type

from

Path of the object in object-store under owner

owner

Owner service of this object

retentionPeriod

Retention period of the object in object-store

to

Url of content to upload

Attributes

Returns

ObjectSummaryWithMd5 wrapped in the effect F

Note

Storing an object on an existing path will overwrite the previously stored object on that path.

def zip(from: Directory, to: File, retentionPeriod: RetentionPeriod, fromOwner: String, toOwner: String)(implicit hc: HeaderCarrier): F[ObjectSummaryWithMd5]

Zip objects in a directory

Zip objects in a directory

Value parameters

from

Path of the directory to be zipped

fromOwner

Owner service of the directory to be zipped

retentionPeriod

Retention period of the object in object-store

to

Path of the target zip file

toOwner

Owner service of the target zip file

Attributes

Returns

ObjectSummaryWithMd5 wrapped in the effect F