Class: BotFramework::Activity
- Defined in:
- lib/bot_framework/models/activity.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
ContactAdded/Removed action.
-
#attachment_layout ⇒ Object
AttachmentLayout - hint for how to deal with multiple attachments Values: [list|carousel] Default:list.
-
#attachments ⇒ Object
Attachments.
-
#channel_data ⇒ Object
Channel specific payload.
-
#channel_id ⇒ Object
ChannelId the activity was on.
-
#conversation ⇒ Object
Conversation.
-
#entities ⇒ Object
Collection of Entity objects, each of which contains metadata about this activity.
-
#from ⇒ Object
Sender address.
-
#history_disclosed ⇒ Object
the previous history of the channel was disclosed.
-
#id ⇒ Object
Id for the activity.
-
#locale ⇒ Object
The language code of the Text field.
-
#members_added ⇒ Object
Array of address added.
-
#members_removed ⇒ Object
Array of addresses removed.
-
#recipient ⇒ Object
(Outbound to bot only) Bot’s address that received the message.
-
#reply_to_id ⇒ Object
the original id this message is a response to.
-
#service_url ⇒ Object
Service endpoint.
-
#summary ⇒ Object
Text to display if you can’t render cards.
-
#text ⇒ Object
Content for the message.
-
#text_format ⇒ Object
Format of text fields [plain|markdown] Default:markdown.
-
#timestamp ⇒ Object
Time when message was sent.
-
#topic_name ⇒ Object
Conversations new topic name.
-
#type ⇒ Object
The type of the activity [message|contactRelationUpdate|converationUpdate|typing].
Class Method Summary collapse
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
Methods inherited from Base
#==, #_deserialize, #_to_hash, #as_json, attr_accessor, attribute_map, #attributes, #attributes_hash, #build_from_hash, #compact_attributes_hash, #eql?, #hash, #initialize, #list_invalid_properties, #to_body, #to_hash, #to_json, #to_s, #valid?
Constructor Details
This class inherits a constructor from BotFramework::Base
Instance Attribute Details
#action ⇒ Object
ContactAdded/Removed action
64 65 66 |
# File 'lib/bot_framework/models/activity.rb', line 64 def action @action end |
#attachment_layout ⇒ Object
AttachmentLayout - hint for how to deal with multiple attachments Values: [list|carousel] Default:list
31 32 33 |
# File 'lib/bot_framework/models/activity.rb', line 31 def @attachment_layout end |
#attachments ⇒ Object
Attachments
55 56 57 |
# File 'lib/bot_framework/models/activity.rb', line 55 def @attachments end |
#channel_data ⇒ Object
Channel specific payload
61 62 63 |
# File 'lib/bot_framework/models/activity.rb', line 61 def channel_data @channel_data end |
#channel_id ⇒ Object
ChannelId the activity was on
16 17 18 |
# File 'lib/bot_framework/models/activity.rb', line 16 def channel_id @channel_id end |
#conversation ⇒ Object
Conversation
22 23 24 |
# File 'lib/bot_framework/models/activity.rb', line 22 def conversation @conversation end |
#entities ⇒ Object
Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed.
58 59 60 |
# File 'lib/bot_framework/models/activity.rb', line 58 def entities @entities end |
#from ⇒ Object
Sender address
19 20 21 |
# File 'lib/bot_framework/models/activity.rb', line 19 def from @from end |
#history_disclosed ⇒ Object
the previous history of the channel was disclosed
43 44 45 |
# File 'lib/bot_framework/models/activity.rb', line 43 def history_disclosed @history_disclosed end |
#id ⇒ Object
Id for the activity
7 8 9 |
# File 'lib/bot_framework/models/activity.rb', line 7 def id @id end |
#locale ⇒ Object
The language code of the Text field
46 47 48 |
# File 'lib/bot_framework/models/activity.rb', line 46 def locale @locale end |
#members_added ⇒ Object
Array of address added
34 35 36 |
# File 'lib/bot_framework/models/activity.rb', line 34 def members_added @members_added end |
#members_removed ⇒ Object
Array of addresses removed
37 38 39 |
# File 'lib/bot_framework/models/activity.rb', line 37 def members_removed @members_removed end |
#recipient ⇒ Object
(Outbound to bot only) Bot’s address that received the message
25 26 27 |
# File 'lib/bot_framework/models/activity.rb', line 25 def recipient @recipient end |
#reply_to_id ⇒ Object
the original id this message is a response to
67 68 69 |
# File 'lib/bot_framework/models/activity.rb', line 67 def reply_to_id @reply_to_id end |
#service_url ⇒ Object
Service endpoint
13 14 15 |
# File 'lib/bot_framework/models/activity.rb', line 13 def service_url @service_url end |
#summary ⇒ Object
Text to display if you can’t render cards
52 53 54 |
# File 'lib/bot_framework/models/activity.rb', line 52 def summary @summary end |
#text ⇒ Object
Content for the message
49 50 51 |
# File 'lib/bot_framework/models/activity.rb', line 49 def text @text end |
#text_format ⇒ Object
Format of text fields [plain|markdown] Default:markdown
28 29 30 |
# File 'lib/bot_framework/models/activity.rb', line 28 def text_format @text_format end |
#timestamp ⇒ Object
Time when message was sent
10 11 12 |
# File 'lib/bot_framework/models/activity.rb', line 10 def @timestamp end |
#topic_name ⇒ Object
Conversations new topic name
40 41 42 |
# File 'lib/bot_framework/models/activity.rb', line 40 def topic_name @topic_name end |
#type ⇒ Object
The type of the activity [message|contactRelationUpdate|converationUpdate|typing]
4 5 6 |
# File 'lib/bot_framework/models/activity.rb', line 4 def type @type end |
Class Method Details
.swagger_types ⇒ Object
Attribute type mapping.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/bot_framework/models/activity.rb', line 70 def self.swagger_types { type: :String, id: :String, timestamp: :DateTime, service_url: :String, channel_id: :String, from: :ChannelAccount, conversation: :ConversationAccount, recipient: :ChannelAccount, text_format: :String, attachment_layout: :String, members_added: :'Array<ChannelAccount>', members_removed: :'Array<ChannelAccount>', topic_name: :String, history_disclosed: :BOOLEAN, locale: :String, text: :String, summary: :String, attachments: :'Array<Attachment>', entities: :'Array<Entity>', channel_data: :Object, action: :String, reply_to_id: :String } end |
Instance Method Details
#reply(message) ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/bot_framework/models/activity.rb', line 97 def reply() return false if type != 'message' new_activity = Activity.new(type: 'message', locale: 'en', text: , from: recipient.to_hash) Conversation.new(service_url).reply_to_activity(conversation.id, id, new_activity) end |