Class: BotFramework::Attachment

Inherits:
Base
  • Object
show all
Defined in:
lib/bot_framework/models/attachment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

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, #list_invalid_properties, #to_body, #to_hash, #to_json, #to_s, #valid?

Constructor Details

#initialize(attributes = {}) ⇒ Attachment

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/bot_framework/models/attachment.rb', line 31

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.key?(:contentType)
    self.content_type = attributes[:contentType]
  end

  self.content_url = attributes[:contentUrl] if attributes.key?(:contentUrl)

  self.content = attributes[:content] if attributes.key?(:content)

  self.name = attributes[:name] if attributes.key?(:name)

  if attributes.key?(:thumbnailUrl)
    self.thumbnail_url = attributes[:thumbnailUrl]
  end
end

Instance Attribute Details

#contentObject

Embedded content



10
11
12
# File 'lib/bot_framework/models/attachment.rb', line 10

def content
  @content
end

#content_typeObject

mimetype/Contenttype for the file



4
5
6
# File 'lib/bot_framework/models/attachment.rb', line 4

def content_type
  @content_type
end

#content_urlObject

Content Url



7
8
9
# File 'lib/bot_framework/models/attachment.rb', line 7

def content_url
  @content_url
end

#nameObject

(OPTIONAL) The name of the attachment



13
14
15
# File 'lib/bot_framework/models/attachment.rb', line 13

def name
  @name
end

#thumbnail_urlObject

(OPTIONAL) Thumbnail associated with attachment



16
17
18
# File 'lib/bot_framework/models/attachment.rb', line 16

def thumbnail_url
  @thumbnail_url
end

Class Method Details

.swagger_typesObject

Attribute type mapping.



19
20
21
22
23
24
25
26
27
# File 'lib/bot_framework/models/attachment.rb', line 19

def self.swagger_types
  {
    content_type: :String,
    content_url: :String,
    content: :Object,
    name: :String,
    thumbnail_url: :String
  }
end