コード例 #1
0
        /// <summary>
        /// used by Workflows to get get actions defined by the Connector. Run when a user registers or refreshes a Connector.
        /// </summary>
        /// <param name="request">The request received from the client.</param>
        /// <param name="context">The context of the server-side call handler being invoked.</param>
        /// <returns>The response to send back to the client (wrapped by a task).</returns>
        public override Task <ActionsResponse> actions(ActionsRequest request, ServerCallContext context)
        {
            //throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
            Field fullName = new Field
            {
                DisplayName = "Full Name",
                Key         = "full_name",
                Description = "User's full name",
                Type        = "text"
            };

            Field salutation = new Field
            {
                DisplayName = "Salutation",
                Key         = "custom_field_value",
                Description = "User-specific salutation",
                Type        = "text"
            };

            Grpc.Action sayHello = new Grpc.Action
            {
                DisplayName = "Say Hello",
                Description = "Returns a friendly hello"
            };
            sayHello.Inputs.Add(fullName);
            sayHello.Outputs.Add(salutation);

            Grpc.ActionsResponse resp = new ActionsResponse();
            resp.Actions.Add(sayHello);

            //return new Task<ActionsResponse>(() => { return resp; });
            //_logger.LogInformation($"Sending hello to {request.Name}");
            return(Task.FromResult(resp));
        }
コード例 #2
0
        public async Task IInvocableActions_GetStandardAsync(ActionsResponse expected)
        {
            using var handler = MockHttpMessageHandler.SetupHandler(expected);
            var api    = handler.SetupApi <IInvocableActions>();
            var result = await api.GetStandardAsync();

            result.Should().BeEquivalentTo(expected);
            handler.ConfirmPath($"/services/data/{Api.Version}/actions/standard");
        }
コード例 #3
0
        public async Task IInvocableActions_GetCustomAsync_Type(ActionsResponse expected, string type)
        {
            using var handler = MockHttpMessageHandler.SetupHandler(expected);
            var api    = handler.SetupApi <IInvocableActions>();
            var result = await api.GetCustomAsync(type);

            result.Should().BeEquivalentTo(expected);
            handler.ConfirmPath($"/services/data/{Api.Version}/actions/custom/{type}");
        }
コード例 #4
0
    public static ActionsResponse setActions(float[] act)
    {
        var Res = new ActionsResponse();
        var Req = new ActionRequest();

        Req.Actions.AddRange(act);
        Res = client.SetActions(Req);
        return(Res);
    }
コード例 #5
0
        public IActionResult OnPostTunel(string[] nameFiles)
        {
            ActionsResponse resp = dataManager.EnviarTunel(nameFiles);

            if (resp.ok)
            {
                return(Ok(resp.message));
            }
            return(Ok(resp.message));
        }
コード例 #6
0
    public static ActionsResponse setActions(float[] act)
    {
        var aRes = new ActionsResponse();
        var aReq = new ActionRequest();

        aReq.Actions.Add(act[0]);
        aReq.Actions.Add(act[1]);
        aRes = client.SetActions(aReq);
        Debug.Log(aRes.ActionsPerformed);
        return(aRes);
    }
コード例 #7
0
    public static void Main()
    {
        var oRes = new ObservationResponse();
        var oReq = new Empty();

        oRes = client.GetObservations(oReq);
        Debug.Log("Observations: " + oRes.Observations);
        var aRes = new ActionsResponse();
        var aReq = new ActionRequest();

        aReq.Actions.Add(1f);
        aReq.Actions.Add(2f);
        aRes = client.SetActions(aReq);
        Debug.Log(aRes.ActionsPerformed);
    }