blob: 43550138cb1d90aaef0204f4cc1b48c6861920db [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/intent.md.
struct Intent {
/// The name of the action represented by this Intent.
///
/// This is nullable for backwards compatibility.
// TODO(MI4-1100): Make action non-nullable.
string? action;
/// An explicit handler for the Intent. Specified as the component URL of the
/// module.
string? handler;
/// NON-FUNCTIONAL: `parameters` is no longer supported but must remain for ABI compatibility.
vector<IntentParameter>? 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.
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? 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.
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 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/action_template.md 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> entity_type;
};