# ExecuteAppFunctionRequest

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

*** ** * ** ***


```
class ExecuteAppFunctionRequest
```

<br />

*** ** * ** ***

Represents a request to execute a specific app function.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html.https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#(android.app.appfunctions.ExecuteAppFunctionRequest).toCompatExecuteAppFunctionRequest(androidx.appfunctions.metadata.AppFunctionMetadata)( functionMetadata: https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata )` Creates a `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#ExecuteAppFunctionRequest(kotlin.String,kotlin.String,androidx.appfunctions.AppFunctionData)( targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, functionIdentifier: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, functionParameters: https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData )` Creates a new `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest`. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 37) https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#ExecuteAppFunctionRequest(kotlin.String,kotlin.String,androidx.appfunctions.AppFunctionData,android.app.AppInteractionAttribution,android.app.appfunctions.AppFunctionActivityId)( targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, functionIdentifier: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, functionParameters: https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData, attribution: https://developer.android.com/reference/android/app/AppInteractionAttribution.html, activityId: https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html? )` Creates a new `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` with attribution. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#toPlatformExecuteAppFunctionRequest()()` Converts `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` to `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#activityId()` The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request. |
| `https://developer.android.com/reference/android/app/AppInteractionAttribution.html?` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#attribution()` The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#functionIdentifier()` The unique string identifier of the app function to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#functionParameters()` The parameters required to invoke this function. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest#targetPackageName()` The package name of the app that hosts the function. |

## Public companion functions

### ExecuteAppFunctionRequest.toCompatExecuteAppFunctionRequest

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

```
@RequiresApi(value = 36)
fun ExecuteAppFunctionRequest.toCompatExecuteAppFunctionRequest(
    functionMetadata: AppFunctionMetadata
): ExecuteAppFunctionRequest
```

Creates a `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`.

The provided `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata` is used to validate the created `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest`.

| Parameters |
|---|---|
| `functionMetadata: https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata` | the `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata` of the function to be executed. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` | The created `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest`. |

## Public constructors

### ExecuteAppFunctionRequest

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

```
ExecuteAppFunctionRequest(
    targetPackageName: String,
    functionIdentifier: String,
    functionParameters: AppFunctionData
)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest`.

| Parameters |
|---|---|
| `targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package name of the app that hosts the function. |
| `functionIdentifier: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The unique string identifier of the app function to be executed. |
| `functionParameters: https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData` | The parameters required to invoke this function. Within this `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters. The data object may have missing parameters. Developers are advised to implement defensive handling measures. |

### ExecuteAppFunctionRequest

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

```
@RequiresApi(value = 37)
ExecuteAppFunctionRequest(
    targetPackageName: String,
    functionIdentifier: String,
    functionParameters: AppFunctionData,
    attribution: AppInteractionAttribution,
    activityId: AppFunctionActivityId? = null
)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/appfunctions/ExecuteAppFunctionRequest` with attribution.

| Parameters |
|---|---|
| `targetPackageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package name of the app that hosts the function. |
| `functionIdentifier: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The unique string identifier of the app function to be executed. |
| `functionParameters: https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData` | The parameters required to invoke this function. Within this `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters. The data object may have missing parameters. Developers are advised to implement defensive handling measures. |
| `attribution: https://developer.android.com/reference/android/app/AppInteractionAttribution.html` | The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked. |
| `activityId: https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html? = null` | The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request. This identifier is used to disambiguate between instances of the same app function running in different activities when the function's `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#scope()` is `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`. If the property's value is `null`, the request targets an app function that is not `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`. |

## Public functions

### toPlatformExecuteAppFunctionRequest

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

```
@RequiresApi(value = 36)
fun toPlatformExecuteAppFunctionRequest(): ExecuteAppFunctionRequest
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html` | The converted `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |

### toString

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

## Public properties

### activityId

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

```
val activityId: AppFunctionActivityId?
```

The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request.

This identifier is used to disambiguate between instances of the same app function running in different activities when the function's `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#scope()` is `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`.

If the property's value is `null`, the request targets an app function that is not `https://developer.android.com/reference/kotlin/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`.

### attribution

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

```
val attribution: AppInteractionAttribution?
```

The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked.

### functionIdentifier

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

```
val functionIdentifier: String
```

The unique string identifier of the app function to be executed.

### functionParameters

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

```
val functionParameters: AppFunctionData
```

The parameters required to invoke this function. Within this `https://developer.android.com/reference/kotlin/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters.

The data object may have missing parameters. Developers are advised to implement defensive handling measures.

### targetPackageName

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

```
val targetPackageName: String
```

The package name of the app that hosts the function.