# ResourceBuilders.Resources

# ResourceBuilders.Resources

Artifact:[androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/ResourceBuilders.java+class:androidx.wear.protolayout.ResourceBuilders.Resources)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/ResourceBuilders.Resources "View this page in Java")

<br />

```
@RequiresSchemaVersion(major = 1, minor = 0)
class ResourceBuilders.Resources
```

<br />

*** ** * ** ***

The resources for a layout.

## Summary

|                                                                                                                                   ### Nested types                                                                                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[ResourceBuilders.Resources.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources.Builder) Builder for[Resources](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources) |

|                                                                                                                                                                                                          ### Public functions                                                                                                                                                                                                          |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[ResourceBuilders.ImageResource](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.ImageResource)`!>` | [getIdToImageMapping](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources#getIdToImageMapping())`()` Gets a map of resource_ids to images, which can be used by layouts.                                                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                                                                                                                      | [getVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources#getVersion())`()` Gets the version of this[Resources](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources)instance. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                                                                                                                      | [toString](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources#toString())`()`                                                                                                                                                       |

## Public functions

### getIdToImageMapping

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getIdToImageMapping(): (Mutable)Map<String!, ResourceBuilders.ImageResource!>
```

Gets a map of resource_ids to images, which can be used by layouts.  

### getVersion

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getVersion(): String
```

Gets the version of this[Resources](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.Resources)instance.

Each layout specifies the version of resources it requires. After fetching a layout, the renderer will use the resources version specified by the layout to separately fetch the resources.

This value must match the version of the resources required by the layout for the layout to render successfully, and must match the resource version specified in ResourcesRequest which triggered this request.  

### toString

```
fun toString(): String
```