pub struct ImagesResource<'a> { /* private fields */ }Expand description
client.images()
Implementations§
Source§impl<'a> ImagesResource<'a>
impl<'a> ImagesResource<'a>
Sourcepub fn get(&self, file_id: impl Display, hash: impl Display) -> Result<Vec<u8>>
pub fn get(&self, file_id: impl Display, hash: impl Display) -> Result<Vec<u8>>
Get a public image
GET /images/{fileId}/{hash}
Returns image bytes for a public image URL and applies Glide transformations. The hash grants access without a login. SVG content is returned without transformation as an attachment.
Use Self::get_with to pass query parameters.
§Example
let data = client.images().get(42, "abc123")?;
std::fs::write("ergebnis.bin", &data)?;Sourcepub fn get_with(
&self,
file_id: impl Display,
hash: impl Display,
query: &GetImagesFileIdHashQuery,
) -> Result<Vec<u8>>
pub fn get_with( &self, file_id: impl Display, hash: impl Display, query: &GetImagesFileIdHashQuery, ) -> Result<Vec<u8>>
Get a public image
Like Self::get, with query parameters.
GET /images/{fileId}/{hash}
Returns image bytes for a public image URL and applies Glide transformations. The hash grants access without a login. SVG content is returned without transformation as an attachment.
Sourcepub fn get_with_params(
&self,
file_id: impl Display,
hash: impl Display,
query_params: impl Display,
) -> Result<Vec<u8>>
pub fn get_with_params( &self, file_id: impl Display, hash: impl Display, query_params: impl Display, ) -> Result<Vec<u8>>
Get a public image with path-encoded parameters
GET /images/{fileId}/{hash}/{queryParams}
Returns a public image with Glide transformations encoded in the final path segment. Image handling is otherwise identical to GET /images/{fileId}/{hash}.
§Example
let data = client.images().get_with_params(42, "abc123", "fm%3Dwebp%26q%3D80%26w%3D700%26h%3Dauto")?;
std::fs::write("ergebnis.bin", &data)?;Sourcepub fn patch(
&self,
id: impl Display,
body: &ImageUpdate,
) -> Result<ImageMetadataUpdateResult>
pub fn patch( &self, id: impl Display, body: &ImageUpdate, ) -> Result<ImageMetadataUpdateResult>
Update image metadata
PATCH /images/{id}
Updates image description, attribution, AI flag and crop/focus options. Requires update permission for the owning object. Changing image options clears generated image caches.
§Example
let body = models::ImageUpdate {
description: Some(Some("Congregation gathered outside the church.".into())),
..Default::default()
};
let result = client.images().patch(1, &body)?;
println!("{}", result.name);Sourcepub fn update_options(
&self,
id: impl Display,
body: &ImageUpdate,
) -> Result<ImageMetadataUpdateResult>
pub fn update_options( &self, id: impl Display, body: &ImageUpdate, ) -> Result<ImageMetadataUpdateResult>
Update image options and metadata
PUT /images/{id}/options
Updates image metadata through the same handler as PATCH /images/{id}. Requires update permission for the owning object.
§Example
let body = models::ImageUpdate {
description: Some(Some("Congregation gathered outside the church.".into())),
..Default::default()
};
let result = client.images().update_options(1, &body)?;
println!("{}", result.name);