code42 0.2.0 → 0.2.1

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 (20) hide show
  1. data/README.md +1 -1
  2. data/code42.gemspec +1 -1
  3. data/lib/code42/attribute_serializer.rb +4 -2
  4. data/lib/code42/version.rb +1 -1
  5. data/spec/cassettes/Code42_Client/_create_org/returns_created_org.yml +43 -16
  6. data/spec/cassettes/Code42_Client/_create_user/returns_created_user.yml +34 -13
  7. data/spec/cassettes/Code42_Client/_create_user/when_sending_an_invalid_email/raises_an_exception.yml +8 -6
  8. data/spec/cassettes/Code42_Client/_find_org_by_name/returns_the_org_with_the_specified_name.yml +54 -34
  9. data/spec/cassettes/Code42_Client/_get_token/returns_valid_tokens.yml +17 -7
  10. data/spec/cassettes/Code42_Client/_get_token/when_providing_invalid_credentials/should_raise_an_exception.yml +8 -6
  11. data/spec/cassettes/Code42_Client/_org/when_ID_is_not_passed/returns_my_org.yml +51 -33
  12. data/spec/cassettes/Code42_Client/_org/when_ID_is_passed_in/returns_a_specific_org.yml +51 -33
  13. data/spec/cassettes/Code42_Client/_ping/returns_a_ping.yml +22 -27
  14. data/spec/cassettes/Code42_Client/_user/when_ID_is_not_passed/returns_my_user.yml +42 -32
  15. data/spec/cassettes/Code42_Client/_user/when_ID_is_passed_in/returns_a_specific_user.yml +42 -32
  16. data/spec/cassettes/Code42_Client/_user/when_blocked/returns_the_blocked_status.yml +53 -39
  17. data/spec/cassettes/Code42_Client/_user/when_unblocked/returns_the_blocked_status.yml +55 -41
  18. data/spec/cassettes/Code42_Client/_user_roles/returns_an_enumerable.yml +29 -29
  19. data/spec/cassettes/Code42_Client/_validate_token/returns_a_valid_response.yml +43 -35
  20. metadata +4 -5
@@ -12,43 +12,61 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
- - ! '*/*'
15
+ - '*/*'
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message: !binary |-
20
- T0s=
19
+ message: OK
21
20
  headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
21
+ Cache-Control:
22
+ - no-store
23
+ Pragma:
24
+ - no-cache
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Server:
30
+ - Jetty(7.6.3.v20120416)
40
31
  body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAJ2SwXKCMBCG7z4Fk7M4BERHbq16YDq1HbUPkOKKmZKECUtH
44
- xuHdmwDWAe2l3PJl98+//3IZOQ4RgOzAkJHIcZyLIYYhF1AgE7mBxPdo4Hoz
45
- l9I9DaNgFlF/Mp8uXC+MPI+M246caSYKU36pDagtJUNVpdP4YAAd/54/uAXk
46
- afUab8gNb5iAO24MYVk0OEH+DVfO2lPkoC6hY5+ZSr7Aah9ZVsDNJEh862zI
47
- Msu6C6zy5r31Zr/evm/j3foqDmcELVkW3/s8cdBMJ6dqqUqJ7ezdVaLkkaex
48
- PIHmyGQCD0o0MORKrhhCm7KJ2AtdP7ApUxoFiwkNBykLdeBHngwae+uZRlM6
49
- mfuzfqOGlBeom8YXqGzfefDdSnOlkcu057YsUIllM1Y/6QLQFhfNoq+rtlbZ
50
- eWcmtNztFt7S5wqhpQ2sBzpdaM3u/hIk5JEgIQ8Fd6UQTFf/9md/51H9AygL
51
- Y0MrAwAA
32
+ encoding: UTF-8
33
+ string: |-
34
+ {
35
+ "metadata": {
36
+ "timestamp": "2013-06-13T15:16:30.317-05:00",
37
+ "params": {}
38
+ },
39
+ "data": {
40
+ "orgId": 1,
41
+ "orgUid": "ADMIN",
42
+ "orgName": "ADMIN",
43
+ "status": "Active",
44
+ "active": true,
45
+ "blocked": false,
46
+ "parentOrgId": null,
47
+ "type": "ENTERPRISE",
48
+ "externalId": "ADMIN",
49
+ "hierarchyCounts": {},
50
+ "configInheritanceCounts": {},
51
+ "creationDate": "2006-05-23T15:11:39.159-05:00",
52
+ "modificationDate": "2013-06-13T15:14:38.120-05:00",
53
+ "registrationKey": "xxxxxxxxxxxxxxxx",
54
+ "reporting": {},
55
+ "customConfig": true,
56
+ "settings": {
57
+ "maxSeats": -1,
58
+ "maxBytes": -1
59
+ },
60
+ "settingsInherited": {
61
+ "maxSeats": "",
62
+ "maxBytes": ""
63
+ },
64
+ "settingsSummary": {
65
+ "maxSeats": -1,
66
+ "maxBytes": -1
67
+ }
68
+ }
69
+ }
52
70
  http_version:
53
- recorded_at: Tue, 11 Jun 2013 20:36:12 GMT
71
+ recorded_at: Thu, 13 Jun 2013 20:16:30 GMT
54
72
  recorded_with: VCR 2.5.0
@@ -12,37 +12,32 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
- - ! '*/*'
15
+ - '*/*'
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message: !binary |-
20
- T0s=
19
+ message: OK
21
20
  headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
21
+ Cache-Control:
22
+ - no-store
23
+ Pragma:
24
+ - no-cache
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Server:
30
+ - Jetty(7.6.3.v20120416)
40
31
  body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAC3MPQqAMAwG0N1ThMxWEquCPYcXCLWDQ0FsnErvbkTX9/3U
44
- DgBzUtlFBQMAVBMzPXIqKvk0xJHYO1oc88Zz8EtgP4zr5GgORNh/i1MuycXq
45
- tRm0V/F/rVjuGFN5U73u1Lr2ABGVoIR5AAAA
32
+ encoding: UTF-8
33
+ string: |-
34
+ {
35
+ "metadata": {
36
+ "timestamp": "2013-06-13T15:16:29.837-05:00",
37
+ "params": {}
38
+ },
39
+ "data": {"success": true}
40
+ }
46
41
  http_version:
47
- recorded_at: Tue, 11 Jun 2013 20:36:13 GMT
42
+ recorded_at: Thu, 13 Jun 2013 20:16:29 GMT
48
43
  recorded_with: VCR 2.5.0
@@ -12,42 +12,52 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
- - ! '*/*'
15
+ - '*/*'
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message: !binary |-
20
- T0s=
19
+ message: OK
21
20
  headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
21
+ Cache-Control:
22
+ - no-store
23
+ Pragma:
24
+ - no-cache
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Server:
30
+ - Jetty(7.6.3.v20120416)
40
31
  body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAJWSTW7CMBCF95wi8pogOym0ZJeKLLIoRTQ9wBA7xWpsQzyh
44
- Qoi71y6hBFAXXfp7M/Pmx4dBEBAlEDggkCQIgoMjjqFUwiKojYMkoiwO6SRk
45
- rGDjJJ4kLB6x6Cmk44RSMjxlbKABZV344ejA0VNyW7W1osm5I2x4Ae/SE4Lr
46
- r3rdvu7lNrK7FS+3lVIRF0pzebZwDWHrLUhaotwJ0quiQQmvAFdSnwWhQNZ3
47
- tJKNxXkXn/aVGv4Qtq1ByPXzHoX3D8/9m+bjah737sZJZy/5nFzwb9k+h9MY
48
- SYBNKzq2qk35KXyNCmor+pMsGqPMjSD1TuJduDMs9psfw2xeZMvFMn/LbteV
49
- 21Rn3Yb6yWUjAKXRM0BxOr+7PX0I2WPBoiSm7uij6ZRen18ZLitZ/iPR/5LB
50
- 8Rv18F6oggIAAA==
32
+ encoding: UTF-8
33
+ string: |-
34
+ {
35
+ "metadata": {
36
+ "timestamp": "2013-06-13T15:16:30.059-05:00",
37
+ "params": {}
38
+ },
39
+ "data": {
40
+ "userId": 1,
41
+ "userUid": "thwlhuOyiq2svbdcqfmm2demndi",
42
+ "status": "Active",
43
+ "username": "admin",
44
+ "email": "admin",
45
+ "firstName": "Admin",
46
+ "lastName": "Admin",
47
+ "quotaInBytes": -1,
48
+ "orgId": 1,
49
+ "orgUid": "ADMIN",
50
+ "orgName": "ADMIN",
51
+ "active": true,
52
+ "blocked": false,
53
+ "emailPromo": false,
54
+ "invited": false,
55
+ "orgType": "ENTERPRISE",
56
+ "usernameIsAnEmail": false,
57
+ "creationDate": "2006-04-17T12:30:00.990-05:00",
58
+ "modificationDate": "2006-04-17T12:30:00.990-05:00"
59
+ }
60
+ }
51
61
  http_version:
52
- recorded_at: Tue, 11 Jun 2013 20:36:13 GMT
62
+ recorded_at: Thu, 13 Jun 2013 20:16:30 GMT
53
63
  recorded_with: VCR 2.5.0
@@ -12,42 +12,52 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
- - ! '*/*'
15
+ - '*/*'
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message: !binary |-
20
- T0s=
19
+ message: OK
21
20
  headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
21
+ Cache-Control:
22
+ - no-store
23
+ Pragma:
24
+ - no-cache
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Server:
30
+ - Jetty(7.6.3.v20120416)
40
31
  body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAI2SQXOCMBCF7/4KJmdxEqi0ctORA4dax9JzZ4VQMyVEk8WO
44
- 4/jfGxAqeGh7zJe3+5I37zxyHCI5QgYIJHQc52yJZSgkNwhybyHxKPNdGriM
45
- JWwa+kHI/AkLApdOQ0rJ+DqxBw3SWPn5YsGlpuR+a2W4jjNLvPENvImaENx9
46
- Fbvq5SQOnjlus/SQS+llXJYZdBb2QVjVFmSeojjysbMoVPrJM9JbV4LktQTS
47
- VFUlvkNlUEMhfrZwCaL4VZELbXD1154C/iE6VAohLhcn5PXDXdZypT+aIHrn
48
- Nof58jlekRvuLAYcmv9bjLriLdu2WQxg89m1VlJZnkNhugtRHgU26j61fslp
49
- 3/hFqyTarDfxa3SfbmzmZdSG2B9ONQcUqlwC8mttbGfog8seE+aFPrVlmcxm
50
- dFgbqTKRi/RucNC3aeg9TehTN1i3a3T5Br40MGq6AgAA
32
+ encoding: UTF-8
33
+ string: |-
34
+ {
35
+ "metadata": {
36
+ "timestamp": "2013-06-13T15:16:30.098-05:00",
37
+ "params": {}
38
+ },
39
+ "data": {
40
+ "userId": 2,
41
+ "userUid": "thwlhuOyiq2svbdcqfmm2demnda",
42
+ "status": "Active, Blocked",
43
+ "username": "account_australia",
44
+ "email": "account_australia",
45
+ "firstName": "account_australia",
46
+ "lastName": "account_australia",
47
+ "quotaInBytes": -1,
48
+ "orgId": 1,
49
+ "orgUid": "ADMIN",
50
+ "orgName": "ADMIN",
51
+ "active": true,
52
+ "blocked": true,
53
+ "emailPromo": false,
54
+ "invited": false,
55
+ "orgType": "ENTERPRISE",
56
+ "usernameIsAnEmail": false,
57
+ "creationDate": "2006-04-17T12:30:00.990-05:00",
58
+ "modificationDate": "2013-06-13T15:14:39.525-05:00"
59
+ }
60
+ }
51
61
  http_version:
52
- recorded_at: Tue, 11 Jun 2013 20:36:13 GMT
62
+ recorded_at: Thu, 13 Jun 2013 20:16:30 GMT
53
63
  recorded_with: VCR 2.5.0
@@ -2,21 +2,23 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: put
5
- uri: http://admin:admin@localhost:7280/api/userblock/2
5
+ uri: http://admin:admin@localhost:7280/api/UserBlock/2
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{}'
8
+ string: '{}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.8.7
12
12
  Content-Type:
13
13
  - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
16
  Accept:
15
- - ! '*/*'
17
+ - '*/*'
16
18
  response:
17
19
  status:
18
- code: 204
19
- message: No Content
20
+ code: 201
21
+ message: Created
20
22
  headers:
21
23
  Cache-Control:
22
24
  - no-store
@@ -24,13 +26,15 @@ http_interactions:
24
26
  - no-cache
25
27
  Content-Type:
26
28
  - application/json
29
+ Content-Length:
30
+ - '0'
27
31
  Server:
28
32
  - Jetty(7.6.3.v20120416)
29
33
  body:
30
- encoding: US-ASCII
34
+ encoding: UTF-8
31
35
  string: ''
32
36
  http_version:
33
- recorded_at: Tue, 11 Jun 2013 20:36:13 GMT
37
+ recorded_at: Thu, 13 Jun 2013 20:16:30 GMT
34
38
  - request:
35
39
  method: get
36
40
  uri: http://admin:admin@localhost:7280/api/user/2
@@ -43,42 +47,52 @@ http_interactions:
43
47
  Accept-Encoding:
44
48
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
45
49
  Accept:
46
- - ! '*/*'
50
+ - '*/*'
47
51
  response:
48
52
  status:
49
53
  code: 200
50
- message: !binary |-
51
- T0s=
54
+ message: OK
52
55
  headers:
53
- !binary "Q2FjaGUtQ29udHJvbA==":
54
- - !binary |-
55
- bm8tc3RvcmU=
56
- !binary "UHJhZ21h":
57
- - !binary |-
58
- bm8tY2FjaGU=
59
- !binary "Q29udGVudC1UeXBl":
60
- - !binary |-
61
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
62
- !binary "Q29udGVudC1FbmNvZGluZw==":
63
- - !binary |-
64
- Z3ppcA==
65
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
66
- - !binary |-
67
- Y2h1bmtlZA==
68
- !binary "U2VydmVy":
69
- - !binary |-
70
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
56
+ Cache-Control:
57
+ - no-store
58
+ Pragma:
59
+ - no-cache
60
+ Content-Type:
61
+ - application/json; charset=utf-8
62
+ Transfer-Encoding:
63
+ - chunked
64
+ Server:
65
+ - Jetty(7.6.3.v20120416)
71
66
  body:
72
- encoding: ASCII-8BIT
73
- string: !binary |-
74
- H4sIAAAAAAAAAI2SQXOCMBCF7/4KJmdxEqhWuenIgUOtY+m5s0KomRKiyWLH
75
- cfzvDQgKHtoe8+XtvuTNOw8ch0iOkAICCRzHOVtiGQrJDYLcW0g8ynyXTlzG
76
- YjYO/EnA/BGdei4dB5SS4XViDxqksfLzxYJLRcnj1tJwHaWWeMM7eBcVIbj7
77
- znfl60kcPHPcpskhk9JLuSxSaC3sg7CsLMg8QXHkQ2eRq+SLp6SzrgDJKwkk
78
- iSoL/IDSoIZc3LZwCSL/VZEJbXD1154c/iE6lAohKhYn5NXDXdZwpT/rIDrn
79
- Jof58iVakTtuLXoc6v9bjLrkDds2WfRg/dm1VlJZnkFu2gtRHAXW6i61fvFp
80
- X/uFqzjcrDfRW/iYbmTmRdiE2B1ONAcUqlgC8mttbGfok8ueY+YFPrVlGc1m
81
- tF8bqVKRieRhsNe3ceBNbd/awapdg8sP9oPlU7oCAAA=
67
+ encoding: UTF-8
68
+ string: |-
69
+ {
70
+ "metadata": {
71
+ "timestamp": "2013-06-13T15:16:30.243-05:00",
72
+ "params": {}
73
+ },
74
+ "data": {
75
+ "userId": 2,
76
+ "userUid": "thwlhuOyiq2svbdcqfmm2demnda",
77
+ "status": "Active, Blocked",
78
+ "username": "account_australia",
79
+ "email": "account_australia",
80
+ "firstName": "account_australia",
81
+ "lastName": "account_australia",
82
+ "quotaInBytes": -1,
83
+ "orgId": 1,
84
+ "orgUid": "ADMIN",
85
+ "orgName": "ADMIN",
86
+ "active": true,
87
+ "blocked": true,
88
+ "emailPromo": false,
89
+ "invited": false,
90
+ "orgType": "ENTERPRISE",
91
+ "usernameIsAnEmail": false,
92
+ "creationDate": "2006-04-17T12:30:00.990-05:00",
93
+ "modificationDate": "2013-06-13T15:16:30.212-05:00"
94
+ }
95
+ }
82
96
  http_version:
83
- recorded_at: Tue, 11 Jun 2013 20:36:13 GMT
97
+ recorded_at: Thu, 13 Jun 2013 20:16:30 GMT
84
98
  recorded_with: VCR 2.5.0