Class: Viewpoint::EWS::Types::TasksFolder

Inherits:
Object
  • Object
show all
Includes:
Viewpoint::EWS, Viewpoint::EWS::Types, GenericFolder
Defined in:
lib/ews/types/tasks_folder.rb

Constant Summary

Constants included from GenericFolder

GenericFolder::GFOLDER_KEY_ALIAS, GenericFolder::GFOLDER_KEY_PATHS, GenericFolder::GFOLDER_KEY_TYPES

Constants included from StringUtils

StringUtils::DURATION_RE

Constants included from Viewpoint::EWS

ConnectingSID

Constants included from Viewpoint::EWS::Types

KEY_ALIAS, KEY_PATHS, KEY_TYPES, OOF_KEY_ALIAS, OOF_KEY_PATHS, OOF_KEY_TYPES

Instance Attribute Summary

Attributes included from GenericFolder

#subscription_id, #sync_state, #watermark

Attributes included from Viewpoint::EWS

#logger

Attributes included from Viewpoint::EWS::Types

#ews_item

Instance Method Summary collapse

Methods included from GenericFolder

#available_categories, #delete!, #get_all_properties!, #get_events, #initialize, #items, #items_between, #items_since, #push_subscribe, #search_by_subject, #subscribe, #subscribed?, #sync_items!, #synced?, #todays_items, #unsubscribe

Methods included from StringUtils

included

Methods included from ItemAccessors

#copy_items, #export_items, #find_items, #get_item, #get_items, #move_items

Methods included from Viewpoint::EWS

#remove_impersonation, root_logger, #set_impersonation

Methods included from Viewpoint::EWS::Types

#auto_deepen?, #deepen!, #ews_methods, #freeze!, #frozen?, #initialize, #mark_deep!, #method_missing, #methods, #respond_to?, #shallow?, #to_s, #unfreeze!

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Viewpoint::EWS::Types

Instance Method Details

#create_item(attributes) ⇒ Task

Creates a new task

Parameters:

  • attributes (Hash)

    Parameters of the task. Some example attributes are listed below.

Options Hash (attributes):

  • :subject (String)
  • :start_date (Time)
  • :due_date (Time)
  • :reminder_due_by (Time)
  • :reminder_is_set (Boolean)

Returns:

See Also:



16
17
18
19
20
21
22
23
24
25
# File 'lib/ews/types/tasks_folder.rb', line 16

def create_item(attributes)
  template = Viewpoint::EWS::Template::Task.new attributes
  template.saved_item_folder_id = {id: self.id, change_key: self.change_key}
  rm = ews.create_item(template.to_ews_create).response_messages.first
  if rm && rm.success?
    Task.new ews, rm.items.first[:task][:elems].first
  else
    raise EwsCreateItemError, "Could not create item in folder. #{rm.code}: #{rm.message_text}" unless rm
  end
end