# assets

Canonical URL: https://developers.iagenify.com/fr/sdk/ref/brand-object/assets/
Language: fr

`brand.assets.add(asset) · update(id, changes) · remove(id) · byRole(role) · last · lastCredits`

Les photos, vidéos et illustrations avec lesquelles une marque se montre : une devanture, un produit, une équipe. SDK 0.5.2+.

Status: 60 at most · 25 MB uploaded · 200 MB from Cloud · ~1 credit to describe

```javascript
// A file already in the account's Object Storage: nothing is uploaded again.
await brand.assets.add({ cloud: "Brand/storefront.jpg", role: "hero" });

// Or bytes, like a logo.
await brand.assets.add({ name: "team.jpg", content: bytes, role: "team", description: "The roasting team" });

brand.assets.last;          // the resource just added, with its url
brand.assets.lastCredits;   // what its description cost
brand.assets.byRole("hero");
```

## Rôles {#roles}

`hero`, `place`, `interior`, `product`, `team`, `work`, `detail`, `texture` ou `other`.

## Une photo sans description est décrite {#describe}

Un modèle l’écrit, pour environ un crédit, afin qu’un agent ou une page choisisse la bonne image sans la voir. Donnez `description` vous-même, ou `describe: false`, et rien n’est dépensé. Le même fichier ajouté deux fois est réutilisé : `lastReused` le dit.

- [Brand](/fr/sdk/ref/brand-object): Ce que porte une marque, et comment la modifier.
- [api.cloud](/fr/sdk/ref/cloud): L’Object Storage où vivent ces fichiers.

```python
# A file already in the account's Object Storage: nothing is uploaded again.
brand.assets.add({"cloud": "Brand/storefront.jpg", "role": "hero"})

# Or bytes, like a logo.
brand.assets.add({"name": "team.jpg", "content": image_bytes, "role": "team", "description": "The roasting team"})

brand.assets.last           # the resource just added, with its url
brand.assets.last_credits   # what its description cost
brand.assets.by_role("hero")
```
