1 /*
2  * Copyright 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.appfunctions.metadata
18 
19 import androidx.annotation.RestrictTo
20 import androidx.appsearch.annotation.Document
21 import androidx.appsearch.app.AppSearchSchema
22 import com.android.extensions.appfunctions.AppFunctionManager
23 
24 /** A mirror Document class of [android.app.appfunctions.AppFunctionRuntimeMetadata]. */
25 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
26 @Document
27 public data class AppFunctionRuntimeMetadata(
28     @Document.Id val id: String,
29     @Document.Namespace val namespace: String,
30     @Document.StringProperty val functionId: String,
31     @Document.StringProperty val packageName: String,
32     @Document.LongProperty @AppFunctionManager.EnabledState val enabled: Long,
33     @Document.StringProperty(
34         joinableValueType = AppSearchSchema.StringPropertyConfig.JOINABLE_VALUE_TYPE_QUALIFIED_ID,
35         indexingType = AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_EXACT_TERMS,
36     )
37     val appFunctionStaticMetadataQualifiedId: String,
38 ) {
39     public companion object {
40         public const val STATIC_METADATA_JOIN_PROPERTY: String =
41             "appFunctionStaticMetadataQualifiedId"
42     }
43 }
44