blob: 3a8d49080099fb10dc199ddf195d0f86a9aff021 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.modular;
using fuchsia.mem;
/// The Intent struct is a runtime descriptor for an abstract action to be initiated
/// in Fuchsia. For details please see docs/
resource struct Intent {
/// The name of the action represented by this Intent.
/// This is nullable for backwards compatibility.
// TODO( Make action non-nullable.
string:MAX? action;
/// An explicit handler for the Intent. Specified as the component URL of the
/// module.
string:MAX? handler;
/// NON-FUNCTIONAL: `parameters` is no longer supported but must remain for ABI compatibility.
vector<IntentParameter>:MAX? parameters;
/// NON-FUNCTIONAL: `IntentParameter` is no longer supported but must remain for ABI compatibility.
/// A struct representing a parameter that is passed to the handler of an Intent's
/// Action.
resource struct IntentParameter {
/// The name of the parameter. The handler (i.e. selected mod) will be provided
/// with the data for this parameter under a link called `name`.
string:MAX? name;
/// The data that will be passed to the intent handler.
IntentParameterData data;
/// NON-FUNCTIONAL: `IntentParameterData` is no longer supported but must remain defined for
/// `IntentParameter`'s ABI compatibility.
resource union IntentParameterData {
/// Set this if you already have an Entity reference at runtime.
/// Entity.getTypes() will be used to set the constraints for this noun during
/// resolution.
1: string:MAX entity_reference;
/// Set this if you have structured JSON data. Values typically are a JSON
/// object with a "@type" attribute and other associated data. TODO(thatguy):
/// We need to decide if we want to keep this in place, or deprecate this
/// eventually and move entirely to using Entity references.
/// DEPRECATED: Use `entity_reference`.
2: fuchsia.mem.Buffer json;
/// Set this if you want to explicitly define this noun's allowed types. This
/// is also useful in the cases where the noun has a 'direction' of type
/// 'output', and you wish to set the allowable output types from the Module
/// (see docs/modular/manifests/ for a definition of
/// 'direction').
/// Only one entry in `entity_type` must match the constraint specified by
/// the Module for the constraint to be considered satisfied.
3: vector<string:MAX>:MAX entity_type;