AppFunctionMetadata


public final class AppFunctionMetadata

Represents an AppFunction's metadata.

The class provides the essential information to call an AppFunction. The caller has two options to invoke a function:

  • Using function schema to identify input/output: The function schema defines the input and output of a function. If schema is not null, the caller can look up the input/output information based on the schema definition, and call the function accordingly.

  • Examine parameters and response: A function metadata also has parameters and response properties describe the input and output of a function. The caller can examine these fields to obtain the input/output information, and call the function accordingly.

Summary

Public constructors

AppFunctionMetadata

Added in 1.0.0-alpha08
public AppFunctionMetadata(
 @NonNull String id,
 @NonNull String packageName,
 boolean isEnabled,
AppFunctionSchemaMetadata schema,
 @NonNull List<@NonNull AppFunctionParameterMetadata> parameters,
 @NonNull AppFunctionResponseMetadata response,
 @NonNull AppFunctionComponentsMetadata components,
 @NonNull String description,
AppFunctionDeprecationMetadata deprecation
)

Public methods

equals

public boolean equals(Object other)

getComponents

Added in 1.0.0-alpha08
public final @NonNull AppFunctionComponentsMetadatagetComponents()

Reusable components that could be shared within the function specification.

getDeprecation

Added in 1.0.0-alpha08
public final AppFunctionDeprecationMetadatagetDeprecation()

Deprecation details about the function, if the AppFunction is deprecated. This will be null if the function is not deprecated.

getDescription

Added in 1.0.0-alpha08
public final @NonNull StringgetDescription()

A description of the AppFunction and its intended use.

getId

Added in 1.0.0-alpha08
public final @NonNull StringgetId()

The ID used in an androidx.appfunctions.ExecuteAppFunctionRequest to refer to this AppFunction.

getPackageName

Added in 1.0.0-alpha08
public final @NonNull StringgetPackageName()

The package name of the Android app called to execute the app function.

getParameters

Added in 1.0.0-alpha08
public final @NonNull List<@NonNull AppFunctionParameterMetadata> getParameters()

The parameters of the AppFunction.

getResponse

Added in 1.0.0-alpha08
public final @NonNull AppFunctionResponseMetadatagetResponse()

The response of the AppFunction.

getSchema

Added in 1.0.0-alpha08
public final AppFunctionSchemaMetadatagetSchema()

The predefined schema of the AppFunction. If null, it indicates this function is not implement a particular predefined schema.

hashCode

public int hashCode()

isEnabled

Added in 1.0.0-alpha08
public final boolean isEnabled()

Indicates whether the function is enabled currently or not.

toString

public @NonNull StringtoString()