]> git.basschouten.com Git - openhab-addons.git/blob
243e7c59f0f39fc30ecbe1498d9ede3cd7180449
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.mycroft.internal.api.dto;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import org.openhab.binding.mycroft.internal.api.MessageType;
19
20 import com.google.gson.annotations.SerializedName;
21
22 /**
23  * This message is sent to the skills
24  * module to trigger an intent from a text.
25  *
26  * @author Gwendal Roulleau - Initial contribution
27  */
28 public class MessageRecognizerLoopUtterance extends BaseMessage {
29
30     public Data data = new Data();
31
32     public Context context = new Context();
33
34     public MessageRecognizerLoopUtterance() {
35         this.type = MessageType.recognizer_loop__utterance;
36     }
37
38     public MessageRecognizerLoopUtterance(String utterance) {
39         this();
40         this.data.utterances.add(utterance);
41         this.context.clientName = "java_api";
42         this.context.source = "audio";
43         this.context.destination.add("skills");
44     }
45
46     public static class Data {
47         public List<String> utterances = new ArrayList<>();
48     }
49
50     public static class Context {
51         @SerializedName("client_name")
52         public String clientName = "";
53         public String source = "";
54         public List<String> destination = new ArrayList<>();
55     }
56 }