Class: Apps::Outlook::Schema::HttpPOST

Inherits:
Action
  • Object
show all
Defined in:
lib/apps/outlook/schema/http_post.rb

Overview

Constant Summary collapse

RESPONSE_HEADERS =

CARD-ACTION-STATUS - include header in server HTTP POST response See: docs.microsoft.com/en-us/outlook/actionable-messages/card-reference#reporting-an-actions-execution-success-or-failure CARD-UPDATE-IN-BODY - true value indicates to client to refresh content with response body See: docs.microsoft.com/en-us/outlook/actionable-messages/card-reference#refresh-cards

%w[
  CARD-ACTION-STATUS
  CARD-UPDATE-IN-BODY
]
MIME_TYPES =
%w[
  application/json
  application/x-www-form-urlencoded
]

Instance Attribute Summary collapse

Attributes inherited from Action

#name

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

URL



21
22
23
# File 'lib/apps/outlook/schema/http_post.rb', line 21

def body
  @body
end

#body_content_typeObject

URL



21
22
23
# File 'lib/apps/outlook/schema/http_post.rb', line 21

def body_content_type
  @body_content_type
end

#targetObject

URL



21
22
23
# File 'lib/apps/outlook/schema/http_post.rb', line 21

def target
  @target
end

Instance Method Details

#add_header(name, value) ⇒ Object



38
39
40
# File 'lib/apps/outlook/schema/http_post.rb', line 38

def add_header(name, value)
  headers[name] = value
end

#headersObject



25
26
27
# File 'lib/apps/outlook/schema/http_post.rb', line 25

def headers
  @headers ||= {}
end

#serializeObject



29
30
31
32
33
34
35
36
# File 'lib/apps/outlook/schema/http_post.rb', line 29

def serialize
  super.merge(
    "target" => target,
    "headers" => serialize_hash(headers),
    "body" => body,
    "bodyContentType" => body_content_type
  )
end