Module: Viewpoint::EWS::SOAP::ExchangeSynchronization

Includes:
Viewpoint::EWS::SOAP
Included in:
ExchangeWebService
Defined in:
lib/ews/soap/exchange_synchronization.rb

Overview

Exchange Synchronization operations as listed in the EWS Documentation.

Constant Summary

Constants included from Viewpoint::EWS::SOAP

ActiveDirectory, ActiveDirectoryContacts, Contacts, ContactsActiveDirectory, HARD_DELETE, MOVE_TO_DELETED_ITEMS, NAMESPACES, NS_EWS_MESSAGES, NS_EWS_TYPES, NS_SOAP, SOFT_DELETE, VERSION_2007, VERSION_2007_SP1, VERSION_2010, VERSION_2010_SP1, VERSION_2010_SP2, VERSION_2013, VERSION_NONE

Instance Method Summary collapse

Methods included from Viewpoint::EWS::SOAP

#initialize

Instance Method Details

#sync_folder_hierarchy(opts) ⇒ Object

Defines a request to synchronize a folder hierarchy on a client

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :folder_shape (Hash)

    The folder shape properties Ex: => 'Default', :additional_properties => 'bla bla bla'

  • :sync_folder_id (Hash)

    An optional Hash that represents a FolderId or DistinguishedFolderId. Ex: => :inbox

  • :sync_state (Hash)

    The Base64 sync state id. If this is the first time syncing this does not need to be passed.

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ews/soap/exchange_synchronization.rb', line 36

def sync_folder_hierarchy(opts)
  opts = opts.clone
  req = build_soap! do |type, builder|
    if(type == :header)
    else
      builder.nbuild.SyncFolderHierarchy {
        builder.nbuild.parent.default_namespace = @default_ns
        builder.folder_shape!(opts[:folder_shape])
        builder.sync_folder_id!(opts[:sync_folder_id]) if opts[:sync_folder_id]
        builder.sync_state!(opts[:sync_state]) if opts[:sync_state]
      }
    end
  end
  do_soap_request(req, response_class: EwsResponse)
end

#sync_folder_items(opts) ⇒ Object

Synchronizes items between the Exchange server and the client

Examples:

{ :item_shape => {:base_shape => 'Default'},
  :sync_folder_id => {:id => :inbox},
  :sync_state => myBase64id,
  :max_changes_returned => 256 }

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :item_shape (Hash)

    The item shape properties Ex: => 'Default', :additional_properties => 'bla bla bla'

  • :sync_folder_id (Hash)

    A Hash that represents a FolderId or DistinguishedFolderId. [ Ex: => :inbox ] OPTIONAL

  • :sync_state (String)

    The Base64 sync state id. If this is the first time syncing this does not need to be passed. OPTIONAL on first call

  • :ignore (Array <String>)

    An Array of ItemIds for items to ignore during the sync process. Ex: [=> 'id1', :change_key => 'ck', => 'id2'] OPTIONAL

  • :max_changes_returned (Integer) — default: 'required'

    The amount of items to sync per call.

  • :sync_scope (String)

    specifies whether just items or items and folder associated information are returned. OPTIONAL options: 'NormalItems' or 'NormalAndAssociatedItems'

See Also:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/ews/soap/exchange_synchronization.rb', line 73

def sync_folder_items(opts)
  opts = opts.clone
  req = build_soap! do |type, builder|
    if(type == :header)
    else
      builder.nbuild.SyncFolderItems {
        builder.nbuild.parent.default_namespace = @default_ns
        builder.item_shape!(opts[:item_shape])
        builder.sync_folder_id!(opts[:sync_folder_id]) if opts[:sync_folder_id]
        builder.sync_state!(opts[:sync_state]) if opts[:sync_state]
        builder.ignore!(opts[:ignore]) if opts[:ignore]
        builder.max_changes_returned!(opts[:max_changes_returned])
        builder.sync_scope!(opts[:sync_scope]) if opts[:sync_scope]
      }
    end
  end
  do_soap_request(req, response_class: EwsResponse)
end