| // Copyright 2020 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. | 
 | @available(added=HEAD) | 
 | library fuchsia.testing.sl4f; | 
 |  | 
 | using zx; | 
 |  | 
 | /// Implemented by a backend component hosting one or more facades. Used to acquire the list of | 
 | /// facades hosted by a `FacadeProvider` instance. | 
 | closed protocol FacadeIterator { | 
 |     strict GetNext() -> (struct { | 
 |         facades vector<string:MAX>:MAX; | 
 |     }); | 
 | }; | 
 |  | 
 | /// Implemented by a backend component hosting one or more facades. A facade must only be hosted by | 
 | /// a signel `FacadeProvider` instance. | 
 | /// NOTE: The current implementation uses ComponentsV1 and only supports a single `FacadeProvider` | 
 | /// instance. This is intended to change and may result in changes to the protocol. | 
 | @discoverable | 
 | closed protocol FacadeProvider { | 
 |     /// Connect to a `FacadeIterator` to obtain the list of facades hosted by this `FacadeProvider`. | 
 |     strict GetFacades(resource struct { | 
 |         iterator server_end:FacadeIterator; | 
 |     }); | 
 |  | 
 |     /// Executes 'command' on 'facade'. Returns an optional result JSON blob and error string. | 
 |     strict Execute(resource struct { | 
 |         facade string:MAX; | 
 |         command string:MAX; | 
 |         params_blob zx.Handle:VMO; | 
 |     }) -> (resource struct { | 
 |         result_blob zx.Handle:<VMO, optional>; | 
 |         error string:<MAX, optional>; | 
 |     }); | 
 |  | 
 |     /// Cleans up any resources and transient state associated with SL4F facades hosted by this | 
 |     /// `FacadeProvider`. Returns on completion. | 
 |     strict Cleanup() -> (); | 
 |  | 
 |     /// Prints the state of all facades hosted by this `FacadeProvider`. Returns on completion. | 
 |     strict Print() -> (); | 
 | }; |