Polarex.Files (Polarex v0.3.0)
View SourceProvides API endpoints related to files
Summary
Functions
@spec files_create( body :: Polarex.DownloadableFileCreate.t() | Polarex.OrganizationAvatarFileCreate.t() | Polarex.ProductMediaFileCreate.t(), opts :: keyword() ) :: {:ok, Polarex.FileUpload.t()} | {:error, Polarex.HTTPValidationError.t()}
Create File
Create a file.
Scopes: files:write
Request Body
Content Types: application/json
@spec files_delete(id :: String.t(), opts :: keyword()) :: :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.NotPermitted.t() | Polarex.ResourceNotFound.t()}
Delete File
Delete a file.
Scopes: files:write
@spec files_list(opts :: keyword()) :: {:ok, Polarex.ListResourceFileRead.t()} | {:error, Polarex.HTTPValidationError.t()}
List Files
List files.
Scopes: files:read files:write
Options
organization_id: Filter by organization ID.ids: Filter by file ID.page: Page number, defaults to 1.limit: Size of a page, defaults to 10. Maximum is 100.
@spec files_update(id :: String.t(), body :: Polarex.FilePatch.t(), opts :: keyword()) :: {:ok, Polarex.DownloadableFileRead.t() | Polarex.OrganizationAvatarFileRead.t() | Polarex.ProductMediaFileRead.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.NotPermitted.t() | Polarex.ResourceNotFound.t()}
Update File
Update a file.
Scopes: files:write
Request Body
Content Types: application/json
@spec files_uploaded( id :: String.t(), body :: Polarex.FileUploadCompleted.t(), opts :: keyword() ) :: {:ok, Polarex.DownloadableFileRead.t() | Polarex.OrganizationAvatarFileRead.t() | Polarex.ProductMediaFileRead.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.NotPermitted.t() | Polarex.ResourceNotFound.t()}
Complete File Upload
Complete a file upload.
Scopes: files:write
Request Body
Content Types: application/json