# GetSchemaResponse

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/GetSchemaResponse.java+class:androidx.appsearch.app.GetSchemaResponse) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
class GetSchemaResponse
```

<br />

*** ** * ** ***

The response class of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#getSchemaAsync()`

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse` objects. |

| ### Public functions |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://developer.android.com/reference/kotlin/androidx/appsearch/app/PackageIdentifier!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getPubliclyVisibleSchemas()()` Returns a mapping of publicly visible schemas to the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PackageIdentifier` specifying the package the schemas are from. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!>!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getRequiredPermissionsForSchemaTypeVisibility()()` Returns a mapping of schema types to the set of `https://developer.android.com/reference/android/Manifest.permission.html` combination sets that querier must hold to access that schema type. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesNotDisplayedBySystem()()` Returns all the schema types that are opted out of being displayed and visible on any system UI surface. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/SchemaVisibilityConfig!>!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesVisibleToConfigs()()` Returns a mapping of schema types to the set of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SchemaVisibilityConfig` that have access to that schema type. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PackageIdentifier!>!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.ADD_PERMISSIONS_AND_GET_VISIBILITY) https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getSchemaTypesVisibleToPackages()()` Returns a mapping of schema types to the set of packages that have access to that schema type. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getSchemas()()` Return the schemas most recently successfully provided to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)`. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!>!>` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getSchemasWipeoutAccountPropertyPaths()()` Returns a map containing all schema types that have been configured for account wipeout, mapped to the specific property paths within those schemas that hold the account identifiers. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse#getVersion()()` Returns the overall database schema version. |

## Public functions

### getPubliclyVisibleSchemas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getPubliclyVisibleSchemas(): (Mutable)Map<String!, PackageIdentifier!>
```

Returns a mapping of publicly visible schemas to the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PackageIdentifier` specifying the package the schemas are from.

If no schemas have been set as publicly visible, an empty set will be returned.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getRequiredPermissionsForSchemaTypeVisibility

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getRequiredPermissionsForSchemaTypeVisibility(): (Mutable)Map<String!, (Mutable)Set<(Mutable)Set<Int!>!>!>
```

Returns a mapping of schema types to the set of `https://developer.android.com/reference/android/Manifest.permission.html` combination sets that querier must hold to access that schema type.

The querier could read the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GenericDocument` objects under the `schemaType` if they holds ALL required permissions of ANY of the individual value sets.

For example, if the Map contains `{ % verbatim %}{ {permissionA, PermissionB},
{ PermissionC, PermissionD}, {PermissionE}}{ % endverbatim %}`.

- A querier holding both PermissionA and PermissionB has access.
- A querier holding both PermissionC and PermissionD has access.
- A querier holding only PermissionE has access.
- A querier holding both PermissionA and PermissionE has access.
- A querier holding only PermissionA doesn't have access.
- A querier holding only PermissionA and PermissionC doesn't have access.

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!>!>` | The map contains schema type and all combinations of required permission for querier to access it. The supported Permission are `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_SMS()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_CALENDAR()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_CONTACTS()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_EXTERNAL_STORAGE()`, `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_HOME_APP_SEARCH_DATA()` and `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest#READ_ASSISTANT_APP_SEARCH_DATA()`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemaTypesNotDisplayedBySystem

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getSchemaTypesNotDisplayedBySystem(): (Mutable)Set<String!>
```

Returns all the schema types that are opted out of being displayed and visible on any system UI surface.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemaTypesVisibleToConfigs

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getSchemaTypesVisibleToConfigs(): (Mutable)Map<String!, (Mutable)Set<SchemaVisibilityConfig!>!>
```

Returns a mapping of schema types to the set of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SchemaVisibilityConfig` that have access to that schema type.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SetSchemaRequest.Builder#addSchemaTypeVisibleToConfig(java.lang.String,androidx.appsearch.app.SchemaVisibilityConfig)` |   |

### getSchemaTypesVisibleToPackages

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.ADD_PERMISSIONS_AND_GET_VISIBILITY)
fun getSchemaTypesVisibleToPackages(): (Mutable)Map<String!, (Mutable)Set<PackageIdentifier!>!>
```

Returns a mapping of schema types to the set of packages that have access to that schema type.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if `https://developer.android.com/reference/kotlin/androidx/appsearch/app/GetSchemaResponse.Builder#setVisibilitySettingSupported(boolean)` was called with false. |

### getSchemas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getSchemas(): (Mutable)Set<AppSearchSchema!>
```

Return the schemas most recently successfully provided to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)`.

### getSchemasWipeoutAccountPropertyPaths

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
fun getSchemasWipeoutAccountPropertyPaths(): (Mutable)Map<String!, (Mutable)Set<PropertyPath!>!>
```

Returns a map containing all schema types that have been configured for account wipeout, mapped to the specific property paths within those schemas that hold the account identifiers.

This method performs a deep copy to ensure the returned map and its contained sets are immutable from external modifications.

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!>!>` | A map where keys are schema type names, and values are sets of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` strings configured for account wipeout for that schema type. |

### getVersion

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getVersion(): @IntRange(from = 0) Int
```

Returns the overall database schema version.

If the database is empty, 0 will be returned.