zimbra-soap-api 0.0.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.irbrc +6 -0
  4. data/Gemfile +6 -0
  5. data/README +21 -0
  6. data/Rakefile +1 -0
  7. data/lib/zimbra.rb +94 -0
  8. data/lib/zimbra/account.rb +94 -0
  9. data/lib/zimbra/acl.rb +63 -0
  10. data/lib/zimbra/alias.rb +4 -0
  11. data/lib/zimbra/appointment.rb +274 -0
  12. data/lib/zimbra/appointment/alarm.rb +101 -0
  13. data/lib/zimbra/appointment/attendee.rb +97 -0
  14. data/lib/zimbra/appointment/invite.rb +360 -0
  15. data/lib/zimbra/appointment/recur_exception.rb +83 -0
  16. data/lib/zimbra/appointment/recur_rule.rb +184 -0
  17. data/lib/zimbra/appointment/reply.rb +91 -0
  18. data/lib/zimbra/auth.rb +46 -0
  19. data/lib/zimbra/base.rb +217 -0
  20. data/lib/zimbra/calendar.rb +27 -0
  21. data/lib/zimbra/common_elements.rb +51 -0
  22. data/lib/zimbra/cos.rb +124 -0
  23. data/lib/zimbra/delegate_auth_token.rb +49 -0
  24. data/lib/zimbra/directory.rb +175 -0
  25. data/lib/zimbra/distribution_list.rb +147 -0
  26. data/lib/zimbra/domain.rb +63 -0
  27. data/lib/zimbra/ext/handsoap_curb_driver.rb +21 -0
  28. data/lib/zimbra/ext/hash.rb +72 -0
  29. data/lib/zimbra/ext/string.rb +10 -0
  30. data/lib/zimbra/extra/date_helpers.rb +111 -0
  31. data/lib/zimbra/folder.rb +100 -0
  32. data/lib/zimbra/handsoap_account_service.rb +44 -0
  33. data/lib/zimbra/handsoap_service.rb +75 -0
  34. data/lib/zimbra/version.rb +3 -0
  35. data/spec/fixtures/xml_api_requests/appointments/create.xml +84 -0
  36. data/spec/fixtures/xml_api_responses/alarms/15_minutes_before.xml +26 -0
  37. data/spec/fixtures/xml_api_responses/alarms/using_all_intervals.xml +26 -0
  38. data/spec/fixtures/xml_api_responses/appointments/appointment_response_1.xml +40 -0
  39. data/spec/fixtures/xml_api_responses/attendees/one_attendee_and_one_reply.xml +27 -0
  40. data/spec/fixtures/xml_api_responses/attendees/three_attendees_response_1.xml +30 -0
  41. data/spec/fixtures/xml_api_responses/multiple_invites/recurring_with_exceptions.xml +109 -0
  42. data/spec/fixtures/xml_api_responses/recur_rules/day_27_of_every_2_months.xml +27 -0
  43. data/spec/fixtures/xml_api_responses/recur_rules/every_2_days.xml +26 -0
  44. data/spec/fixtures/xml_api_responses/recur_rules/every_3_weeks_on_tuesday_and_friday.xml +30 -0
  45. data/spec/fixtures/xml_api_responses/recur_rules/every_day_50_instances.xml +27 -0
  46. data/spec/fixtures/xml_api_responses/recur_rules/every_monday_wednesday_friday.xml +31 -0
  47. data/spec/fixtures/xml_api_responses/recur_rules/every_tuesday.xml +29 -0
  48. data/spec/fixtures/xml_api_responses/recur_rules/every_weekday_with_end_date.xml +34 -0
  49. data/spec/fixtures/xml_api_responses/recur_rules/every_year_on_february_2.xml +28 -0
  50. data/spec/fixtures/xml_api_responses/recur_rules/first_day_of_every_month.xml +36 -0
  51. data/spec/fixtures/xml_api_responses/recur_rules/first_monday_of_every_february.xml +31 -0
  52. data/spec/fixtures/xml_api_responses/recur_rules/first_weekend_day_of_every_month.xml +31 -0
  53. data/spec/fixtures/xml_api_responses/recur_rules/last_day_of_every_month.xml +36 -0
  54. data/spec/fixtures/xml_api_responses/recur_rules/second_day_of_every_2_months.xml +36 -0
  55. data/spec/fixtures/xml_api_responses/recur_rules/second_wednesday_of_every_month.xml +29 -0
  56. data/spec/fixtures/xml_api_responses/recur_rules/weekly_with_an_exception.xml +44 -0
  57. data/spec/spec_helper.rb +32 -0
  58. data/spec/zimbra/acl_spec.rb +11 -0
  59. data/spec/zimbra/appointment/alarm_spec.rb +33 -0
  60. data/spec/zimbra/appointment/invite_spec.rb +62 -0
  61. data/spec/zimbra/appointment/recur_rule_spec.rb +307 -0
  62. data/spec/zimbra/appointment_spec.rb +175 -0
  63. data/spec/zimbra/common_elements_spec.rb +33 -0
  64. data/spec/zimbra/distribution_list_spec.rb +54 -0
  65. data/zimbra.gemspec +28 -0
  66. metadata +197 -0
@@ -0,0 +1,31 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27629" nextAlarm="1388004900000" d="1387472289000" s="0" l="10">
2
+ <inv id="497" seq="5" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472289000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="5" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="WEE">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="MO"/>
21
+ <wkday day="WE"/>
22
+ <wkday day="FR"/>
23
+ </byday>
24
+ </rule>
25
+ </add>
26
+ </recur>
27
+ <s u="1388005200000" d="20131225T160000" tz="America/New_York"/>
28
+ <e u="1388008800000" d="20131225T170000" tz="America/New_York"/>
29
+ </comp>
30
+ </inv>
31
+ </appt>
@@ -0,0 +1,29 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27628" nextAlarm="1387918500000" d="1387472256000" s="0" l="10">
2
+ <inv id="497" seq="4" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472256000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="4" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="WEE">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="TU"/>
21
+ </byday>
22
+ </rule>
23
+ </add>
24
+ </recur>
25
+ <s u="1387918800000" d="20131224T160000" tz="America/New_York"/>
26
+ <e u="1387922400000" d="20131224T170000" tz="America/New_York"/>
27
+ </comp>
28
+ </inv>
29
+ </appt>
@@ -0,0 +1,34 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27626" nextAlarm="1387486500000" d="1387472181000" s="0" l="10">
2
+ <inv id="497" seq="2" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472181000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="2" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="DAI">
18
+ <until d="20131220T045959Z"/>
19
+ <interval ival="1"/>
20
+ <byday>
21
+ <wkday day="MO"/>
22
+ <wkday day="TU"/>
23
+ <wkday day="WE"/>
24
+ <wkday day="TH"/>
25
+ <wkday day="FR"/>
26
+ </byday>
27
+ </rule>
28
+ </add>
29
+ </recur>
30
+ <s u="1387486800000" d="20131219T160000" tz="America/New_York"/>
31
+ <e u="1387490400000" d="20131219T170000" tz="America/New_York"/>
32
+ </comp>
33
+ </inv>
34
+ </appt>
@@ -0,0 +1,28 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27636" nextAlarm="1391374500000" d="1387472575000" s="0" l="10">
2
+ <inv id="497" seq="12" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472575000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="12" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="YEA">
18
+ <interval ival="1"/>
19
+ <bymonthday modaylist="2"/>
20
+ <bymonth molist="2"/>
21
+ </rule>
22
+ </add>
23
+ </recur>
24
+ <s u="1391374800000" d="20140202T160000" tz="America/New_York"/>
25
+ <e u="1391378400000" d="20140202T170000" tz="America/New_York"/>
26
+ </comp>
27
+ </inv>
28
+ </appt>
@@ -0,0 +1,36 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27632" nextAlarm="1388609700000" d="1387472421000" s="0" l="10">
2
+ <inv id="497" seq="8" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472421000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="8" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="MON">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="SU"/>
21
+ <wkday day="MO"/>
22
+ <wkday day="TU"/>
23
+ <wkday day="WE"/>
24
+ <wkday day="TH"/>
25
+ <wkday day="FR"/>
26
+ <wkday day="SA"/>
27
+ </byday>
28
+ <bysetpos poslist="1"/>
29
+ </rule>
30
+ </add>
31
+ </recur>
32
+ <s u="1388610000000" d="20140101T160000" tz="America/New_York"/>
33
+ <e u="1388613600000" d="20140101T170000" tz="America/New_York"/>
34
+ </comp>
35
+ </inv>
36
+ </appt>
@@ -0,0 +1,31 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27637" nextAlarm="1391460900000" d="1387472617000" s="0" l="10">
2
+ <inv id="497" seq="13" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472617000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="13" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="YEA">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="MO"/>
21
+ </byday>
22
+ <bymonth molist="2"/>
23
+ <bysetpos poslist="1"/>
24
+ </rule>
25
+ </add>
26
+ </recur>
27
+ <s u="1391461200000" d="20140203T160000" tz="America/New_York"/>
28
+ <e u="1391464800000" d="20140203T170000" tz="America/New_York"/>
29
+ </comp>
30
+ </inv>
31
+ </appt>
@@ -0,0 +1,31 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27635" nextAlarm="1391288100000" d="1387472533000" s="0" l="10">
2
+ <inv id="497" seq="11" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472533000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="11" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="MON">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="SU"/>
21
+ <wkday day="SA"/>
22
+ </byday>
23
+ <bysetpos poslist="1"/>
24
+ </rule>
25
+ </add>
26
+ </recur>
27
+ <s u="1391288400000" d="20140201T160000" tz="America/New_York"/>
28
+ <e u="1391292000000" d="20140201T170000" tz="America/New_York"/>
29
+ </comp>
30
+ </inv>
31
+ </appt>
@@ -0,0 +1,36 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27634" nextAlarm="1391201700000" d="1387472498000" s="0" l="10">
2
+ <inv id="497" seq="10" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472498000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="10" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="MON">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday day="SU"/>
21
+ <wkday day="MO"/>
22
+ <wkday day="TU"/>
23
+ <wkday day="WE"/>
24
+ <wkday day="TH"/>
25
+ <wkday day="FR"/>
26
+ <wkday day="SA"/>
27
+ </byday>
28
+ <bysetpos poslist="-1"/>
29
+ </rule>
30
+ </add>
31
+ </recur>
32
+ <s u="1391202000000" d="20140131T160000" tz="America/New_York"/>
33
+ <e u="1391205600000" d="20140131T170000" tz="America/New_York"/>
34
+ </comp>
35
+ </inv>
36
+ </appt>
@@ -0,0 +1,36 @@
1
+ <appt uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" id="498" rev="27633" nextAlarm="1388696100000" d="1387472467000" s="0" l="10">
2
+ <inv id="497" seq="9" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" d="1387472467000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="498" url="" fb="B" calItemId="498" x_uid="1b33102b-6d2e-4d98-ad27-c59a92de9798" name="RECURTEST" seq="9" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="MON">
18
+ <interval ival="2"/>
19
+ <byday>
20
+ <wkday day="SU"/>
21
+ <wkday day="MO"/>
22
+ <wkday day="TU"/>
23
+ <wkday day="WE"/>
24
+ <wkday day="TH"/>
25
+ <wkday day="FR"/>
26
+ <wkday day="SA"/>
27
+ </byday>
28
+ <bysetpos poslist="2"/>
29
+ </rule>
30
+ </add>
31
+ </recur>
32
+ <s u="1388696400000" d="20140102T160000" tz="America/New_York"/>
33
+ <e u="1388700000000" d="20140102T170000" tz="America/New_York"/>
34
+ </comp>
35
+ </inv>
36
+ </appt>
@@ -0,0 +1,29 @@
1
+ <appt uid="1c71d474-5c1f-4048-84e3-9725c0825a44" id="518" rev="27656" nextAlarm="1389209100000" d="1387571704000" s="0" l="10">
2
+ <inv id="517" seq="4" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1c71d474-5c1f-4048-84e3-9725c0825a44" d="1387571704000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="518" url="" fb="B" calItemId="518" x_uid="1c71d474-5c1f-4048-84e3-9725c0825a44" name="Test2222" seq="4" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="MON">
18
+ <interval ival="1"/>
19
+ <byday>
20
+ <wkday ordwk="2" day="WE"/>
21
+ </byday>
22
+ </rule>
23
+ </add>
24
+ </recur>
25
+ <s u="1355340600000" d="20121212T143000" tz="America/New_York"/>
26
+ <e u="1355344200000" d="20121212T153000" tz="America/New_York"/>
27
+ </comp>
28
+ </inv>
29
+ </appt>
@@ -0,0 +1,44 @@
1
+ <appt uid="1c71d474-5c1f-4048-84e3-9725c0825a44" id="518" rev="27644" nextAlarm="1388087700000" d="1387483796000" s="0" l="10">
2
+ <inv id="517" seq="0" compNum="0" type="appt">
3
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
4
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
5
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
6
+ </tz>
7
+ <comp uid="1c71d474-5c1f-4048-84e3-9725c0825a44" d="1387483787000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="518" url="" fb="B" calItemId="518" x_uid="1c71d474-5c1f-4048-84e3-9725c0825a44" name="Test" seq="0" rsvp="0" fba="B" method="PUBLISH" transp="O">
8
+ <alarm action="DISPLAY">
9
+ <trigger>
10
+ <rel neg="1" m="5" related="START"/>
11
+ </trigger>
12
+ <desc/>
13
+ </alarm>
14
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
15
+ <recur>
16
+ <add>
17
+ <rule freq="WEE">
18
+ <interval ival="1"/>
19
+ </rule>
20
+ </add>
21
+ </recur>
22
+ <s u="1387481400000" d="20131219T143000" tz="America/New_York"/>
23
+ <e u="1387485000000" d="20131219T153000" tz="America/New_York"/>
24
+ </comp>
25
+ </inv>
26
+ <inv id="519" recurId="TZID=America/New_York:20131226T143000" seq="1" compNum="0" type="appt">
27
+ <tz id="America/New_York" stdoff="-300" stdname="EST" dayoff="-240" dayname="EDT">
28
+ <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
29
+ <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
30
+ </tz>
31
+ <comp uid="1c71d474-5c1f-4048-84e3-9725c0825a44" ex="1" d="1387483796000" status="CONF" noBlob="1" ciFolder="10" isOrg="1" class="PUB" loc="" compNum="0" apptId="518" url="" fb="B" calItemId="518" x_uid="1c71d474-5c1f-4048-84e3-9725c0825a44" ridZ="20131226T193000Z" name="Test" seq="1" rsvp="0" fba="B" method="PUBLISH" transp="O">
32
+ <alarm action="DISPLAY">
33
+ <trigger>
34
+ <rel neg="1" m="5" related="START"/>
35
+ </trigger>
36
+ <desc/>
37
+ </alarm>
38
+ <or d="Mail03" a="mail03@greenviewdata.com" url="mail03@greenviewdata.com"/>
39
+ <exceptId d="20131226T143000" tz="America/New_York"/>
40
+ <s u="1388088000000" d="20131226T150000" tz="America/New_York"/>
41
+ <e u="1388091600000" d="20131226T160000" tz="America/New_York"/>
42
+ </comp>
43
+ </inv>
44
+ </appt>
@@ -0,0 +1,32 @@
1
+ $:.unshift(File.join(File.dirname(__FILE__),'../lib'))
2
+ require 'zimbra'
3
+ require 'nokogiri'
4
+
5
+ def zimbra_soap_doc(xml)
6
+ Nokogiri::XML.parse(<<XML)
7
+ <?xml version="1.0" encoding="UTF-8"?>
8
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n2="http://foo.bar/baz">
9
+ <soap:Header>
10
+ <context xmlns="urn:zimbra"/>
11
+ </soap:Header>
12
+ <soap:Body>
13
+ #{xml}
14
+ </soap:Body>
15
+ </soap:Envelope>
16
+ XML
17
+ end
18
+
19
+ def new_appointment_from_xml(xml_path)
20
+ xml = File.read(xml_path)
21
+ appointment_hash = Zimbra::Hash.from_xml(xml)
22
+ Zimbra::Appointment.new_from_zimbra_attributes(appointment_hash)
23
+ end
24
+
25
+ RSpec.configure do |config|
26
+
27
+ config.before(:each) do
28
+ @fixture_path = File.join(File.dirname(File.expand_path(__FILE__)), 'fixtures')
29
+ end
30
+
31
+ end
32
+
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__),'../spec_helper')
2
+
3
+ describe Zimbra::ACL do
4
+ describe 'to_zimbra_acl_value' do
5
+ it 'should generate the string to be placed in an acl element' do
6
+ domain = Zimbra::Domain.new('abc123','example.com')
7
+ acl = Zimbra::ACL.new(:target => domain, :name => 'zimbraAdminCosRights')
8
+ acl.to_zimbra_acl_value.should == "abc123 domain zimbraAdminCosRights"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Zimbra::Appointment::Alarm do
4
+ before do
5
+ @xml_api_responses_path = File.join(@fixture_path, 'xml_api_responses', 'alarms')
6
+ end
7
+
8
+ describe ".new_from_zimbra_attributes" do
9
+ @sample_attribute_files = {
10
+ '15_minutes_before.xml' => {
11
+ :duration_negative=>true, :weeks=>nil, :days=>nil, :hours=>nil, :minutes=>15, :seconds=>nil, :when=>:start, :repeat_count=>nil
12
+ },
13
+ 'using_all_intervals.xml' => {
14
+ :duration_negative=>false, :weeks=>1, :days=>2, :hours=>3, :minutes=>15, :seconds=>25, :when=>:end, :repeat_count=>2
15
+ }
16
+ }
17
+
18
+ @sample_attribute_files.each do |file_name, expected_attributes|
19
+ context file_name do
20
+ before do
21
+ @attributes = Zimbra::Hash.from_xml(File.read(File.join(@xml_api_responses_path, file_name)))
22
+ @attributes = @attributes[:appt][:inv][:comp][:alarm]
23
+ @alarm = Zimbra::Appointment::Alarm.new_from_zimbra_attributes(@attributes)
24
+ end
25
+
26
+ it "should match the expected attributes" do
27
+ @alarm.to_hash.should == expected_attributes
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+