Module: Viewpoint::EWS::SOAP::ExchangeTimeZones
- Includes:
- Viewpoint::EWS::SOAP
- Included in:
- ExchangeWebService
- Defined in:
- lib/ews/soap/exchange_time_zones.rb
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_2013_SP1, VERSION_NONE
Instance Method Summary collapse
-
#get_time_zones(full = false, ids = nil) ⇒ Array
Request list of server known time zones.
-
#set_time_zone_context(id) ⇒ Object
Sets the time zone context header.
Methods included from Viewpoint::EWS::SOAP
Instance Method Details
#get_time_zones(full = false, ids = nil) ⇒ Array
TODO:
Implement TimeZoneDefinition with sub elements Periods, TransitionsGroups and Transitions
Request list of server known time zones
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ews/soap/exchange_time_zones.rb', line 14 def get_time_zones(full = false, ids = nil) req = build_soap! do |type, builder| unless type == :header builder.get_server_time_zones!(full: full, ids: ids) end end result = do_soap_request req, response_class: EwsSoapResponse if result.success? zones = [] result..each do || elements = [:get_server_time_zones_response_message][:elems][:time_zone_definitions][:elems] elements.each do |definition| data = { id: definition[:time_zone_definition][:attribs][:id], name: definition[:time_zone_definition][:attribs][:name] } zones << OpenStruct.new(data) end end zones else raise EwsError, "Could not get time zones" end end |
#set_time_zone_context(id) ⇒ Object
Sets the time zone context header
47 48 49 50 51 52 53 |
# File 'lib/ews/soap/exchange_time_zones.rb', line 47 def set_time_zone_context(id) if id @time_zone_context = {id: id} else @time_zone_context = nil end end |