# ExecuteAppFunctionResponse.Success

Artifact: [androidx.appfunctions:appfunctions](https://developer.android.com/jetpack/androidx/releases/appfunctions) [View Source](https://cs.android.com/search?q=file:androidx/appfunctions/ExecuteAppFunctionResponse.kt+class:androidx.appfunctions.ExecuteAppFunctionResponse.Success) Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

*** ** * ** ***


```
public final class ExecuteAppFunctionResponse.Success implements ExecuteAppFunctionResponse
```

<br />

*** ** * ** ***

Represents a successful execution of an app function.

## Summary

| ### Constants |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success#PROPERTY_RETURN_VALUE()` The key name of the property that stores the function return value within `result`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success#Success(androidx.appfunctions.AppFunctionData)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData returnValue)` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success#getReturnValue()()` The return value of the executed function. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success#(android.app.appfunctions.ExecuteAppFunctionResponse).toCompatExecuteAppFunctionResponse(androidx.appfunctions.metadata.AppFunctionMetadata)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata functionMetadata )` Creates `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success#toPlatformExecuteAppFunctionResponse()()` Converts `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse` to `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html`. |

## Constants

### PROPERTY_RETURN_VALUE

```
public static final @NonNull String PROPERTY_RETURN_VALUE
```

The key name of the property that stores the function return value within `result`.

See `https://developer.android.com/reference/androidx/appfunctions/AppFunctionData` documentation on retrieving expected fields.

## Public constructors

### Success

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

```
public Success(@NonNull AppFunctionData returnValue)
```

## Public methods

### getReturnValue

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

```
public final @NonNull AppFunctionData getReturnValue()
```

The return value of the executed function. An `https://developer.android.com/reference/androidx/appfunctions/AppFunctionData#EMPTY()` indicates that the function does not produce a return value.

### toCompatExecuteAppFunctionResponse

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

```
@RequiresApi(value = 36)
public static final @NonNull ExecuteAppFunctionResponse.Success toCompatExecuteAppFunctionResponse(
    @NonNull ExecuteAppFunctionResponse receiver,
    @NonNull AppFunctionMetadata functionMetadata
)
```

Creates `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html`.

The resulting response object is validated against the provided `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata functionMetadata` | the `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata` of the function that was executed. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse.Success` | The created `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse`. |

### toPlatformExecuteAppFunctionResponse

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

```
@RequiresApi(value = 36)
public final @NonNull ExecuteAppFunctionResponse toPlatformExecuteAppFunctionResponse()
```

Converts `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionResponse` to `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html` | The converted `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionResponse.html`. |