Class Definition

class @com.gmail #_[name="Gmail Account"] #_[description="Connect your ThingEngine with Gmail to access and manage your emails."] #[version=52] #[package_version=52] { import loader from @org.thingpedia.v2(); import config from @org.thingpedia.config.oauth2(client_id="739906609557-o52ck15e1ge7deb8l0e80q92mpua1p55.apps.googleusercontent.com", client_secret="<hidden>"); monitorable list query inbox(out sender_name: String #_[canonical="sender name"] #[string_values="tt:person_full_name"], out sender_address: Entity(tt:email_address) #_[canonical="sender address"], out subject: String #_[canonical="subject"] #[string_values="tt:email_subject"], out date: Date #_[canonical="date"], out labels: Array(String) #_[canonical="labels"], out snippet: String #_[canonical="snippet"] #[string_values="tt:long_free_text"], out thread_id: Entity(com.gmail:thread_id) #_[canonical="thread id"], out email_id: Entity(com.gmail:email_id) #_[canonical="email id"], in opt is_important: Boolean #_[canonical="is important"], in opt is_primary: Boolean #_[canonical="is primary"]) #_[canonical="list email in inbox"] #_[confirmation="the emails in your GMail inbox"] #_[confirmation_remote="the emails in $__person's GMail inbox"] #_[formatted=[{type="text",text="From ${sender_name} <${sender_address}>: ${subject}"}, {type="text",text="${snippet}"}]] #[poll_interval=3600000ms] #[doc="retrieve your inbox"]; action send_email(in req to: Entity(tt:email_address) #_[prompt="Who do you want to send to?"] #_[canonical="to"], in req subject: String #_[prompt="With what subject?"] #_[canonical="subject"] #[string_values="tt:email_subject"], in req message: String #_[prompt="What message do you want to send?"] #_[canonical="message"] #[string_values="tt:long_free_text"]) #_[canonical="send email on gmail"] #_[confirmation="send an email to $to with subject $subject on GMail"] #_[confirmation_remote="send an email to $to with subject $subject using $__person's GMail"] #[doc="send an email"]; action send_picture(in req to: Entity(tt:email_address) #_[prompt="Who do you want to send to?"] #_[canonical="to"], in req subject: String #_[prompt="With what subject?"] #_[canonical="subject"] #[string_values="tt:email_subject"], in req message: String #_[prompt="What message do you want to send?"] #_[canonical="message"] #[string_values="tt:long_free_text"], in req picture_url: Entity(tt:picture) #_[prompt="Upload the picture now."] #_[canonical="picture url"]) #_[canonical="send picture on gmail"] #_[confirmation="send a picture to $to with subject $subject on GMail"] #_[confirmation_remote="send a picture to $to with subject $subject using $__person's GMail"] #[doc="send an email with a picture attached"]; action reply(in req email_id: Entity(com.gmail:email_id) #_[prompt="What email do you want to reply to?"] #_[canonical="email id"], in opt subject: String #_[canonical="subject"] #[string_values="tt:email_subject"], in req message: String #_[prompt="What do you want to say in your reply?"] #_[canonical="message"] #[string_values="tt:long_free_text"]) #_[canonical="gmail reply email"] #_[confirmation="reply to $email_id saying $message"] #_[confirmation_remote="reply to $email_id saying $message from $__person's GMail"] #[doc="reply to emails"]; action forward(in req email_id: Entity(com.gmail:email_id) #_[prompt="What email do you want to forward?"] #_[canonical="email id"], in req to: Entity(tt:email_address) #_[prompt="Who do you want to forward it to?"] #_[canonical="to"], in req message: String #_[prompt="What do you want to say in the email?"] #_[canonical="message"] #[string_values="tt:long_free_text"]) #_[canonical="gmail forward email"] #_[confirmation="forward $email_id to $to saying $message with your GMail"] #_[confirmation_remote="forward $email_id to $to saying $message with $__person's GMail"] #[doc="forward an email"]; }

Dataset

dataset @com.gmail language "en" { stream := monitor (@com.gmail.inbox()) on new [email_id] #_[utterances=["when i receive an email on Gmail", "when somebody emails me", "when somebody sends me an email", "when somebody sends me an email on gmail"]] #[id=27925312] #[name=""]; stream (p_sender_address :Entity(tt:email_address)) := monitor ((@com.gmail.inbox()), sender_address == p_sender_address) on new [email_id] #_[utterances=["when i receive an email from ${p_sender_address:no-undefined} on Gmail", "when ${p_sender_address:no-undefined} sends me an email", "when ${p_sender_address:no-undefined} emails me"]] #[id=27925316] #[name=""]; stream := monitor (@com.gmail.inbox(is_important=true)) on new [email_id] #_[utterances=["when i receive an email marked as important", "when i receive an important email"]] #[id=27925319] #[name=""]; stream (p_sender_address :Entity(tt:email_address)) := monitor ((@com.gmail.inbox(is_important=true)), sender_address == p_sender_address) on new [email_id] #_[utterances=["when i receive an important email from ${p_sender_address:no-undefined}"]] #[id=27925321] #[name=""]; query := @com.gmail.inbox(is_primary=true) #_[utterances=["my primary category emails"]] #[id=27925322] #[name=""]; stream (p_sender_address :Entity(tt:email_address)) := monitor ((@com.gmail.inbox(is_primary=true)), sender_address == p_sender_address) #_[utterances=["if i receive an email from ${p_sender_address:no-undefined} in category primary"]] #[id=27925323] #[name=""]; query := @com.gmail.inbox() #_[utterances=["my latest email", "my emails", "my emails on gmail", "my gmail", "my gmail inbox"]] #[id=27925324] #[name=""]; query (p_sender_address :Entity(tt:email_address)) := (@com.gmail.inbox()), sender_address == p_sender_address #_[utterances=["my emails from $p_sender_address", "emails i received from $p_sender_address", "emails i got from $p_sender_address"]] #[id=27925329] #[name=""]; query (p_label :String) := (@com.gmail.inbox()), contains(labels, p_label) #_[utterances=["my emails with label $p_label", "my emails labelled $p_label", "my emails that have label $p_label"]] #[id=27925332] #[name=""]; query (p_subject :String) := (@com.gmail.inbox()), subject =~ p_subject #_[utterances=["my emails with subject $p_subject"]] #[id=27925335] #[name=""]; action (p_to :Entity(tt:email_address), p_subject :String, p_message :String) := @com.gmail.send_email(to=p_to, subject=p_subject, message=p_message) #_[utterances=["send an email to $p_to with subject $p_subject with message $p_message using my gmail", "send an email to $p_to with subject $p_subject with message $p_message", "email $p_to with subject $p_subject and message $p_message"]] #[id=27925336] #[name=""]; action (p_to :Entity(tt:email_address), p_subject :String) := @com.gmail.send_picture(to=p_to, subject=p_subject, message=$?, picture_url=$?) #_[utterances=["send a picture to $p_to with subject $p_subject using my gmail", "send a picture to $p_to with subject $p_subject", "email a picture to $p_to with subject $p_subject"]] #[id=27925339] #[name=""]; action (p_to :Entity(tt:email_address)) := @com.gmail.send_email(to=p_to, subject=$?, message=$?) #_[utterances=["send an email to $p_to using my gmail", "email $p_to", "reply to ${p_to}"]] #[id=27925342] #[name=""]; action := @com.gmail.send_email(to=$?, subject=$?, message=$?) #_[utterances=["send an email to somebody"]] #[id=27925345] #[name=""]; action (p_subject :String) := @com.gmail.send_email(to=$?, subject=p_subject, message=$?) #_[utterances=["send an email with subject $p_subject"]] #[id=27925346] #[name=""]; action (p_to :Entity(tt:email_address)) := @com.gmail.send_picture(to=p_to, subject=$?, message=$?, picture_url=$?) #_[utterances=["email a picture to $p_to", "send a picture to $p_to"]] #[id=27925347] #[name=""]; query := (@com.gmail.inbox()), date >= start_of(day) #_[utterances=["emails arrived today", "emails arrived in the last hour"]] #[id=27925349] #[name=""]; query := (@com.gmail.inbox()), date >= start_of(day) - 1day #_[utterances=["emails arrived yesterday"]] #[id=27925351] #[name=""]; query := @com.gmail.inbox(is_important=true) #_[utterances=["important emails"]] #[id=27925352] #[name=""]; action (p_email_id :Entity(com.gmail:email_id), p_message :String) := @com.gmail.reply(email_id=p_email_id, message=p_message) #_[utterances=["reply to ${p_email_id} saying ${p_message}"]] #[id=27925353] #[name=""]; action (p_email_id :Entity(com.gmail:email_id), p_message :String, p_subject :String) := @com.gmail.reply(email_id=p_email_id, message=p_message, subject=p_subject) #_[utterances=["reply to ${p_email_id} saying ${p_message} , add ${p_subject} to the subject"]] #[id=27925354] #[name=""]; action (p_email_id :Entity(com.gmail:email_id)) := @com.gmail.reply(email_id=p_email_id, message=$?) #_[utterances=["reply to ${p_email_id}"]] #[id=27925355] #[name=""]; action (p_to :Entity(tt:email_address), p_message :String) := @com.gmail.send_email(to=p_to, message=p_message, subject=$?) #_[utterances=["reply to ${p_to} saying ${p_message}", "send $p_message to $p_to"]] #[id=27925356] #[name=""]; action (p_email_id :Entity(com.gmail:email_id), p_to :Entity(tt:email_address), p_message :String) := @com.gmail.forward(email_id=p_email_id, to=p_to, message=p_message) #_[utterances=["forward ${p_email_id} to ${p_to} saying ${p_message}"]] #[id=27925358] #[name=""]; action (p_email_id :Entity(com.gmail:email_id), p_to :Entity(tt:email_address)) := @com.gmail.forward(email_id=p_email_id, to=p_to, message=$?) #_[utterances=["forward ${p_email_id} to ${p_to}"]] #[id=27925359] #[name=""]; query := @com.gmail.inbox(is_important=false) #_[utterances=["my unimportant emails"]] #[id=27925360] #[name=""]; action (p_to :Entity(tt:email_address), p_subject :String, p_picture_url :Entity(tt:picture)) := @com.gmail.send_picture(to=p_to, subject=p_subject, picture_url=p_picture_url, message=$?) #_[utterances=["send $p_picture_url to $p_to with subject $p_subject"]] #[id=27925361] #[name=""]; action (p_to :Entity(tt:email_address), p_picture_url :Entity(tt:picture)) := @com.gmail.send_picture(to=p_to, picture_url=p_picture_url, subject=$?, message=$?) #_[utterances=["send $p_picture_url to $p_to"]] #[id=27925362] #[name=""]; action := @com.gmail.send_picture(to=$?, subject=$?, message=$?, picture_url=$?) #_[utterances=["send a picture via email"]] #[id=27925363] #[name=""]; action (p_message :String) := @com.gmail.send_email(message=p_message, to=$?, subject=$?) #_[utterances=["send $p_message via email", "send $p_message via gmail"]] #[id=27925364] #[name=""]; action (p_picture_url :Entity(tt:picture)) := @com.gmail.send_picture(picture_url=p_picture_url, to=$?, subject=$?, message=$?) #_[utterances=["send $p_picture_url via email", "send $p_picture_url via gmail"]] #[id=27925366] #[name=""]; }