class Store

Methods

__construct(FileProvider&StoreProvider $provider, string $id, string|null $name, StoreFileCounts $fileCounts, bool $ready)

Create a new store instance.

add(StorableFile|UploadedFile|HasProviderId|string $file, array $metadata = [])

Add a file to the store.

string
fileIdFor(HasProviderId|string $documentId)

Resolve the ID of the file a document was imported from, which Gemini does not reuse as the document ID.

storeFile(StorableFile $file)

Store the given file with the provider.

fakeableFileProvider()

Get the file provider, using a fake gateway if files are faked.

bool
remove(HasProviderId|string $documentId, bool $deleteFile = false)

Remove a document from the store.

refresh()

Refresh the store from the provider.

bool
delete()

Delete the store from the provider.

assertAdded(Closure|string $fileId)

Assert that a file was added to the store.

assertNotAdded(Closure|string $fileId)

Assert that a file was not added to the store.

assertRemoved(Closure|string $documentId)

Assert that a document was removed from the store.

assertNotRemoved(Closure|string $documentId)

Assert that a document was not removed from the store.

fileAssertionCallback(Closure|string $fileId)

Get a callback for matching file assertions on this store.

bool
fileIdMatches(StorableFile|HasProviderId|string $file, string $expectedFileId)

Determine if the given file matches the expected file ID.

Details

at line 23
__construct(FileProvider&StoreProvider $provider, string $id, string|null $name, StoreFileCounts $fileCounts, bool $ready)

Create a new store instance.

Parameters

FileProvider&StoreProvider $provider
string $id
string|null $name
StoreFileCounts $fileCounts
bool $ready

at line 35
AddedDocumentResponse add(StorableFile|UploadedFile|HasProviderId|string $file, array $metadata = [])

Add a file to the store.

Parameters

StorableFile|UploadedFile|HasProviderId|string $file
array $metadata

Return Value

AddedDocumentResponse

at line 65
protected string fileIdFor(HasProviderId|string $documentId)

Resolve the ID of the file a document was imported from, which Gemini does not reuse as the document ID.

Parameters

HasProviderId|string $documentId

Return Value

string

at line 77
protected HasProviderId storeFile(StorableFile $file)

Store the given file with the provider.

Parameters

StorableFile $file

Return Value

HasProviderId

at line 85
protected FileProvider fakeableFileProvider()

Get the file provider, using a fake gateway if files are faked.

Return Value

FileProvider

at line 96
bool remove(HasProviderId|string $documentId, bool $deleteFile = false)

Remove a document from the store.

Parameters

HasProviderId|string $documentId
bool $deleteFile

Return Value

bool

at line 110
Store refresh()

Refresh the store from the provider.

Return Value

Store

at line 118
bool delete()

Delete the store from the provider.

Return Value

bool

at line 126
Store assertAdded(Closure|string $fileId)

Assert that a file was added to the store.

Parameters

Closure|string $fileId

Return Value

Store

at line 136
Store assertNotAdded(Closure|string $fileId)

Assert that a file was not added to the store.

Parameters

Closure|string $fileId

Return Value

Store

at line 146
Store assertRemoved(Closure|string $documentId)

Assert that a document was removed from the store.

Parameters

Closure|string $documentId

Return Value

Store

at line 156
Store assertNotRemoved(Closure|string $documentId)

Assert that a document was not removed from the store.

Parameters

Closure|string $documentId

Return Value

Store

at line 166
protected Closure fileAssertionCallback(Closure|string $fileId)

Get a callback for matching file assertions on this store.

Parameters

Closure|string $fileId

Return Value

Closure

at line 178
protected bool fileIdMatches(StorableFile|HasProviderId|string $file, string $expectedFileId)

Determine if the given file matches the expected file ID.

Parameters

StorableFile|HasProviderId|string $file
string $expectedFileId

Return Value

bool