AppFunctionAllOfTypeMetadata


class AppFunctionAllOfTypeMetadata : AppFunctionDataTypeMetadata


Defines the schema of a single object data type that is a composition of all of the other types in the matchAll list.

An object of this type must match all of the AppFunctionDataTypeMetadata in the matchAll list. matchAll takes an array of object definitions that are composed together to a single object to form this type. Note that while this composition offers object type extensibility, it does not imply a hierarchy between the objects matched in matchAll i.e. the resulting single object is a flattened representation of all the other matched objects.

For example, consider the following objects:

open class Address (
open val street: String,
open val city: String,
open val state: String,
open val zipCode: String,
)


class PersonWithAddress (
override val street: String,
override val city: String,
override val state: String,
override val zipCode: String,
val name: String,
val age: Int,
)
: Address(street, city, state, zipCode)

The following AppFunctionAllOfTypeMetadata can be used to define a data type that matches PersonWithAddress.

val personWithAddressType = AppFunctionAllOfTypeMetadata(
qualifiedName = "androidx.appfunctions.metadata.PersonWithAddress",
matchAll = listOf(
AppFunctionObjectTypeMetadata(
properties = mapOf(
"street" to AppFunctionPrimitiveTypeMetadata(...),
"city" to AppFunctionPrimitiveTypeMetadata(...),
"state" to AppFunctionPrimitiveTypeMetadata(...),
"zipCode" to AppFunctionPrimitiveTypeMetadata(...),
),
required = listOf("street", "city", "state", "zipCode"),
qualifiedName = "androidx.appfunctions.metadata.Address",
isNullable = false,
),
AppFunctionObjectTypeMetadata(
properties = mapOf(
"name" to AppFunctionPrimitiveTypeMetadata(...),
"age" to AppFunctionPrimitiveTypeMetadata(...),
),
required = listOf("name", "age"),
qualifiedName = "androidx.appfunctions.metadata.PersonWithAddress",
isNullable = false,
),
),
isNullable = false,
)

This data type can be used to define the schema of an input or output type.

Summary

Public constructors

AppFunctionAllOfTypeMetadata(
    matchAll: List<AppFunctionDataTypeMetadata>,
    qualifiedName: String?,
    isNullable: Boolean
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

List<AppFunctionDataTypeMetadata>

The list of data types that are composed.

String?

The composed object's qualified name if available.

Inherited properties

From androidx.appfunctions.metadata.AppFunctionDataTypeMetadata
Boolean

Whether the data type is nullable.

Public constructors

AppFunctionAllOfTypeMetadata

AppFunctionAllOfTypeMetadata(
    matchAll: List<AppFunctionDataTypeMetadata>,
    qualifiedName: String?,
    isNullable: Boolean
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

matchAll

Added in 1.0.0-alpha01
val matchAllList<AppFunctionDataTypeMetadata>

The list of data types that are composed.

qualifiedName

Added in 1.0.0-alpha01
val qualifiedNameString?

The composed object's qualified name if available. For example, "androidx.appfunctions.metadata.PersonWithAddress".

Use this value to set androidx.appfunctions.AppFunctionData.qualifiedName when trying to build the parameters for androidx.appfunctions.ExecuteAppFunctionRequest.