Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# MigrationFailure

*** ** * ** ***

```
class MigrationFailure : Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.appsearch.SetSchemaResponse.MigrationFailure](https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#) |

The class represents a post-migrated `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be saved by `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSession#setSchema(android.app.appsearch.SetSchemaRequest,%20java.util.concurrent.Executor,%20java.util.concurrent.Executor,%20java.util.function.Consumer)`.

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#MigrationFailure(kotlin.String,%20kotlin.String,%20kotlin.String,%20android.app.appsearch.AppSearchResult)(namespace: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, documentId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, schemaType: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, failedResult: https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult<*>)` Constructs a new `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#`. |

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open [AppSearchResult](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!\> | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#getAppSearchResult()()` Returns the `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult` that indicates why the post-migration `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` failed to be indexed. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#getDocumentId()()` Returns the id of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#getNamespace()()` Returns the namespace of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#getSchemaType()()` Returns the schema type of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#toString()()` Returns a string representation of the object. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[SetSchemaResponse.MigrationFailure](https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#)!\> | `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#CREATOR:android.os.Parcelable.Creator` <br /> |

## Public constructors

### MigrationFailure

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
MigrationFailure(
    namespace: String, 
    documentId: String, 
    schemaType: String, 
    failedResult: AppSearchResult<*>)
```

Constructs a new `https://developer.android.com/reference/kotlin/android/app/appsearch/SetSchemaResponse.MigrationFailure#`.

| Parameters ||
|---|---|
| `namespace` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The namespace of the document which failed to be migrated. This value cannot be `null`. |
| `documentId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The id of the document which failed to be migrated. This value cannot be `null`. |
| `schemaType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The type of the document which failed to be migrated. This value cannot be `null`. |
| `failedResult` | [AppSearchResult](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult)\<\*\>: The reason why the document failed to be indexed. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided `failedResult` was not a failure. |

## Public methods

### describeContents

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getAppSearchResult

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getAppSearchResult(): AppSearchResult<Void!>
```

Returns the `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult` that indicates why the post-migration `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` failed to be indexed.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult<https://developer.android.com/reference/kotlin/java/lang/Void.html#!>` | This value cannot be `null`. |

### getDocumentId

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getDocumentId(): String
```

Returns the id of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### getNamespace

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getNamespace(): String
```

Returns the namespace of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### getSchemaType

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun getSchemaType(): String
```

Returns the schema type of the `https://developer.android.com/reference/kotlin/android/app/appsearch/GenericDocument` that failed to be migrated.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### toString

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

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

Returns a string representation of the object.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### writeToParcel

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 13](https://developer.android.com/sdkExtensions)

```
static val CREATOR: Parcelable.Creator<SetSchemaResponse.MigrationFailure!>
```