mxhero-api 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. data/VERSION +1 -1
  2. data/lib/communication.rb +35 -0
  3. data/lib/groups.rb +178 -0
  4. data/lib/mxhero-api.rb +288 -312
  5. data/lib/urls.rb +19 -0
  6. data/mxhero-api.gemspec +4 -4
  7. data/test/fixtures/api/account_properties.yml +12 -13
  8. data/test/fixtures/api/account_properties_not_found.yml +9 -9
  9. data/test/fixtures/api/accounts.yml +39 -0
  10. data/test/fixtures/api/accounts_filtered.yml +57 -42
  11. data/test/fixtures/api/accounts_from_domain.yml +10 -10
  12. data/test/fixtures/api/accounts_from_domain_paginated.yml +10 -10
  13. data/test/fixtures/api/accounts_without_group.yml +75 -0
  14. data/test/fixtures/api/add_an_inexistent_account_to_group.yml +39 -0
  15. data/test/fixtures/api/add_and_remove_account.yml +219 -0
  16. data/test/fixtures/api/all_groups.yml +39 -0
  17. data/test/fixtures/api/create_rule_for_domain.yml +95 -21
  18. data/test/fixtures/api/delete_group.yml +75 -0
  19. data/test/fixtures/api/delete_rule.yml +21 -61
  20. data/test/fixtures/api/domain_by_id.yml +10 -10
  21. data/test/fixtures/api/domain_by_id_not_found.yml +9 -9
  22. data/test/fixtures/api/domain_rule.yml +62 -76
  23. data/test/fixtures/api/domains.yml +10 -10
  24. data/test/fixtures/api/remove_account_from_group_twice.yml +150 -0
  25. data/test/fixtures/api/remove_inexistente_account_from_group.yml +39 -0
  26. data/test/fixtures/api/rules_for_domain.yml +11 -57
  27. data/test/fixtures/api/rules_for_domain_by_component.yml +6 -8
  28. data/test/fixtures/api/save_group.yml +119 -0
  29. data/test/fixtures/api/update_account_properties.yml +35 -33
  30. data/test/fixtures/api/update_rule.yml +35 -76
  31. data/test/helper.rb +1 -1
  32. data/test/test_groups.rb +104 -0
  33. data/test/test_mxhero_api.rb +49 -27
  34. metadata +26 -7
  35. data/test/fixtures/api/create_rule_alredy_exist.yml +0 -81
  36. data/test/fixtures/api/create_rule_success.yml +0 -41
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxhero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-09-10 00:00:00.000000000 Z
14
+ date: 2013-09-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: vcr
@@ -77,26 +77,37 @@ files:
77
77
  - README.md
78
78
  - Rakefile
79
79
  - VERSION
80
+ - lib/communication.rb
81
+ - lib/groups.rb
80
82
  - lib/mxhero-api.rb
83
+ - lib/urls.rb
81
84
  - mxhero-api.gemspec
82
85
  - test/fixtures/api/account_properties.yml
83
86
  - test/fixtures/api/account_properties_not_found.yml
87
+ - test/fixtures/api/accounts.yml
84
88
  - test/fixtures/api/accounts_filtered.yml
85
89
  - test/fixtures/api/accounts_from_domain.yml
86
90
  - test/fixtures/api/accounts_from_domain_paginated.yml
87
- - test/fixtures/api/create_rule_alredy_exist.yml
91
+ - test/fixtures/api/accounts_without_group.yml
92
+ - test/fixtures/api/add_an_inexistent_account_to_group.yml
93
+ - test/fixtures/api/add_and_remove_account.yml
94
+ - test/fixtures/api/all_groups.yml
88
95
  - test/fixtures/api/create_rule_for_domain.yml
89
- - test/fixtures/api/create_rule_success.yml
96
+ - test/fixtures/api/delete_group.yml
90
97
  - test/fixtures/api/delete_rule.yml
91
98
  - test/fixtures/api/domain_by_id.yml
92
99
  - test/fixtures/api/domain_by_id_not_found.yml
93
100
  - test/fixtures/api/domain_rule.yml
94
101
  - test/fixtures/api/domains.yml
102
+ - test/fixtures/api/remove_account_from_group_twice.yml
103
+ - test/fixtures/api/remove_inexistente_account_from_group.yml
95
104
  - test/fixtures/api/rules_for_domain.yml
96
105
  - test/fixtures/api/rules_for_domain_by_component.yml
106
+ - test/fixtures/api/save_group.yml
97
107
  - test/fixtures/api/update_account_properties.yml
98
108
  - test/fixtures/api/update_rule.yml
99
109
  - test/helper.rb
110
+ - test/test_groups.rb
100
111
  - test/test_mxhero_api.rb
101
112
  - test/test_mxhero_api_response.rb
102
113
  homepage: http://github.com/mxhero/mxhero-api
@@ -114,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
125
  version: '0'
115
126
  segments:
116
127
  - 0
117
- hash: 1574735906110401669
128
+ hash: 26454545830041960
118
129
  required_rubygems_version: !ruby/object:Gem::Requirement
119
130
  none: false
120
131
  requirements:
@@ -130,21 +141,29 @@ summary: A MxHero API client for ruby
130
141
  test_files:
131
142
  - test/fixtures/api/account_properties.yml
132
143
  - test/fixtures/api/account_properties_not_found.yml
144
+ - test/fixtures/api/accounts.yml
133
145
  - test/fixtures/api/accounts_filtered.yml
134
146
  - test/fixtures/api/accounts_from_domain.yml
135
147
  - test/fixtures/api/accounts_from_domain_paginated.yml
136
- - test/fixtures/api/create_rule_alredy_exist.yml
148
+ - test/fixtures/api/accounts_without_group.yml
149
+ - test/fixtures/api/add_an_inexistent_account_to_group.yml
150
+ - test/fixtures/api/add_and_remove_account.yml
151
+ - test/fixtures/api/all_groups.yml
137
152
  - test/fixtures/api/create_rule_for_domain.yml
138
- - test/fixtures/api/create_rule_success.yml
153
+ - test/fixtures/api/delete_group.yml
139
154
  - test/fixtures/api/delete_rule.yml
140
155
  - test/fixtures/api/domain_by_id.yml
141
156
  - test/fixtures/api/domain_by_id_not_found.yml
142
157
  - test/fixtures/api/domain_rule.yml
143
158
  - test/fixtures/api/domains.yml
159
+ - test/fixtures/api/remove_account_from_group_twice.yml
160
+ - test/fixtures/api/remove_inexistente_account_from_group.yml
144
161
  - test/fixtures/api/rules_for_domain.yml
145
162
  - test/fixtures/api/rules_for_domain_by_component.yml
163
+ - test/fixtures/api/save_group.yml
146
164
  - test/fixtures/api/update_account_properties.yml
147
165
  - test/fixtures/api/update_rule.yml
148
166
  - test/helper.rb
167
+ - test/test_groups.rb
149
168
  - test/test_mxhero_api.rb
150
169
  - test/test_mxhero_api_response.rb
@@ -1,81 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: http://admin:password@localhost:8080/webapi/api/v1/rules
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"twoWays":false,"enabled":true,"name":"Email footer","created":1369682598000,"fromDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"toDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"properties":[{"propertyKey":"return.message","propertyValue":"footer
9
- content"}],"component":"org.mxhero.feature.disclaimer"}'
10
- headers:
11
- Accept:
12
- - application/json
13
- Content-Type:
14
- - application/json
15
- Authorization:
16
- - Basic YWRtaW46cGFzc3dvcmQ=
17
- response:
18
- status:
19
- code: 201
20
- message: !binary |-
21
- Q3JlYXRlZA==
22
- headers:
23
- !binary "U2VydmVy":
24
- - !binary |-
25
- QXBhY2hlLUNveW90ZS8xLjE=
26
- !binary "Q29udGVudC1UeXBl":
27
- - !binary |-
28
- YXBwbGljYXRpb24vanNvbg==
29
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
30
- - !binary |-
31
- Y2h1bmtlZA==
32
- !binary "RGF0ZQ==":
33
- - !binary |-
34
- RnJpLCAwOSBBdWcgMjAxMyAwNzo0NTowOCBHTVQ=
35
- body:
36
- encoding: US-ASCII
37
- string: ! '{"id":121,"domain":null,"name":"Email footer","created":1376034308000,"updated":1376034308000,"enabled":true,"twoWays":false,"adminOrder":null,"component":"org.mxhero.feature.disclaimer","fromDirection":{"id":227,"directionType":"domain","freeValue":"tesla.com","domain":"tesla.com","account":null,"group":null},"toDirection":{"id":228,"directionType":"domain","freeValue":"tesla.com","domain":"tesla.com","account":null,"group":null},"properties":[{"propertyKey":"return.message","propertyValue":"footer
38
- content"}]}'
39
- http_version:
40
- recorded_at: Tue, 13 Aug 2013 18:28:46 GMT
41
- - request:
42
- method: post
43
- uri: http://admin:password@localhost:8080/webapi/api/v1/rules
44
- body:
45
- encoding: UTF-8
46
- string: ! '{"twoWays":false,"enabled":true,"name":"Email footer","created":1369682598000,"fromDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"toDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"properties":[{"propertyKey":"return.message","propertyValue":"footer
47
- content"}],"component":"org.mxhero.feature.disclaimer"}'
48
- headers:
49
- Accept:
50
- - application/json
51
- Content-Type:
52
- - application/json
53
- Authorization:
54
- - Basic YWRtaW46cGFzc3dvcmQ=
55
- response:
56
- status:
57
- code: 500
58
- message: !binary |-
59
- SW50ZXJuYWwgU2VydmVyIEVycm9y
60
- headers:
61
- !binary "U2VydmVy":
62
- - !binary |-
63
- QXBhY2hlLUNveW90ZS8xLjE=
64
- !binary "Q29udGVudC1UeXBl":
65
- - !binary |-
66
- YXBwbGljYXRpb24vanNvbg==
67
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
68
- - !binary |-
69
- Y2h1bmtlZA==
70
- !binary "RGF0ZQ==":
71
- - !binary |-
72
- RnJpLCAwOSBBdWcgMjAxMyAwNzo0NTowOCBHTVQ=
73
- !binary "Q29ubmVjdGlvbg==":
74
- - !binary |-
75
- Y2xvc2U=
76
- body:
77
- encoding: US-ASCII
78
- string: ! '{"status":500,"code":500,"developerMessage":"rules.already.exists.for.component","moreInfoUrl":"mailto:support@mxhero.com"}'
79
- http_version:
80
- recorded_at: Tue, 13 Aug 2013 18:28:46 GMT
81
- recorded_with: VCR 2.5.0
@@ -1,41 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: http://admin:password@localhost:8080/webapi/api/v1/rules
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"twoWays":false,"enabled":true,"name":"Email footer","created":1369682598000,"fromDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"toDirection":{"directionType":"domain","domain":"tesla.com","freeValue":"tesla.com"},"properties":[{"propertyKey":"return.message","propertyValue":"footer
9
- content"}],"component":"org.mxhero.feature.disclaimer"}'
10
- headers:
11
- Accept:
12
- - application/json
13
- Content-Type:
14
- - application/json
15
- Authorization:
16
- - Basic YWRtaW46cGFzc3dvcmQ=
17
- response:
18
- status:
19
- code: 201
20
- message: !binary |-
21
- Q3JlYXRlZA==
22
- headers:
23
- !binary "U2VydmVy":
24
- - !binary |-
25
- QXBhY2hlLUNveW90ZS8xLjE=
26
- !binary "Q29udGVudC1UeXBl":
27
- - !binary |-
28
- YXBwbGljYXRpb24vanNvbg==
29
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
30
- - !binary |-
31
- Y2h1bmtlZA==
32
- !binary "RGF0ZQ==":
33
- - !binary |-
34
- RnJpLCAwOSBBdWcgMjAxMyAwNzozOToxNiBHTVQ=
35
- body:
36
- encoding: US-ASCII
37
- string: ! '{"id":119,"domain":null,"name":"Email footer","created":1376033956000,"updated":1376033956000,"enabled":true,"twoWays":false,"adminOrder":null,"component":"org.mxhero.feature.disclaimer","fromDirection":{"id":223,"directionType":"domain","freeValue":"tesla.com","domain":"tesla.com","account":null,"group":null},"toDirection":{"id":224,"directionType":"domain","freeValue":"tesla.com","domain":"tesla.com","account":null,"group":null},"properties":[{"propertyKey":"return.message","propertyValue":"footer
38
- content"}]}'
39
- http_version:
40
- recorded_at: Tue, 13 Aug 2013 18:22:55 GMT
41
- recorded_with: VCR 2.5.0