artikcloud 2.0.5 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -1
- data/LICENSE +1 -2
- data/README.md +50 -4
- data/artikcloud.gemspec +29 -5
- data/docs/DeviceTask.md +13 -0
- data/docs/DeviceTaskUpdateRequest.md +8 -0
- data/docs/DeviceTaskUpdateResponse.md +8 -0
- data/docs/DeviceTypeInfo.md +14 -0
- data/docs/DeviceTypeInfoEnvelope.md +8 -0
- data/docs/DeviceTypesApi.md +61 -0
- data/docs/DeviceTypesInfo.md +14 -0
- data/docs/DeviceTypesInfoEnvelope.md +8 -0
- data/docs/DevicesManagementApi.md +870 -0
- data/docs/EventFeedData.md +10 -0
- data/docs/MetadataEnvelope.md +8 -0
- data/docs/MetadataPropertiesEnvelope.md +8 -0
- data/docs/MetadataQueryEnvelope.md +11 -0
- data/docs/MetadataRequest.md +7 -0
- data/docs/Task.md +18 -0
- data/docs/TaskByDid.md +19 -0
- data/docs/TaskByDidList.md +8 -0
- data/docs/TaskByDidListEnvelope.md +11 -0
- data/docs/TaskEnvelope.md +8 -0
- data/docs/TaskHistory.md +13 -0
- data/docs/TaskHistoryList.md +8 -0
- data/docs/TaskList.md +8 -0
- data/docs/TaskListEnvelope.md +12 -0
- data/docs/TaskParameters.md +9 -0
- data/docs/TaskRequest.md +13 -0
- data/docs/TaskStatus.md +13 -0
- data/docs/TaskStatusCounts.md +12 -0
- data/docs/TaskStatuses.md +19 -0
- data/docs/TaskStatusesEnvelope.md +11 -0
- data/docs/TaskStatusesHistoryEnvelope.md +8 -0
- data/docs/TaskUpdateRequest.md +8 -0
- data/docs/TaskUpdateResponse.md +8 -0
- data/docs/TasksStatusCounts.md +11 -0
- data/lib/artikcloud/api/device_types_api.rb +66 -0
- data/lib/artikcloud/api/devices_management_api.rb +971 -0
- data/lib/artikcloud/models/device_task.rb +250 -0
- data/lib/artikcloud/models/device_task_update_request.rb +200 -0
- data/lib/artikcloud/models/device_task_update_response.rb +200 -0
- data/lib/artikcloud/models/device_type_info.rb +260 -0
- data/lib/artikcloud/models/device_type_info_envelope.rb +199 -0
- data/lib/artikcloud/models/device_types_info.rb +260 -0
- data/lib/artikcloud/models/device_types_info_envelope.rb +199 -0
- data/lib/artikcloud/models/event_feed_data.rb +222 -0
- data/lib/artikcloud/models/metadata_envelope.rb +202 -0
- data/lib/artikcloud/models/metadata_properties_envelope.rb +201 -0
- data/lib/artikcloud/models/metadata_query_envelope.rb +232 -0
- data/lib/artikcloud/models/metadata_request.rb +190 -0
- data/lib/artikcloud/models/task.rb +302 -0
- data/lib/artikcloud/models/task_by_did.rb +314 -0
- data/lib/artikcloud/models/task_by_did_list.rb +202 -0
- data/lib/artikcloud/models/task_by_did_list_envelope.rb +230 -0
- data/lib/artikcloud/models/task_envelope.rb +200 -0
- data/lib/artikcloud/models/task_history.rb +250 -0
- data/lib/artikcloud/models/task_history_list.rb +202 -0
- data/lib/artikcloud/models/task_list.rb +202 -0
- data/lib/artikcloud/models/task_list_envelope.rb +240 -0
- data/lib/artikcloud/models/task_parameters.rb +210 -0
- data/lib/artikcloud/models/task_request.rb +252 -0
- data/lib/artikcloud/models/task_status.rb +250 -0
- data/lib/artikcloud/models/task_status_counts.rb +240 -0
- data/lib/artikcloud/models/task_statuses.rb +314 -0
- data/lib/artikcloud/models/task_statuses_envelope.rb +230 -0
- data/lib/artikcloud/models/task_statuses_history_envelope.rb +200 -0
- data/lib/artikcloud/models/task_update_request.rb +200 -0
- data/lib/artikcloud/models/task_update_response.rb +200 -0
- data/lib/artikcloud/models/tasks_status_counts.rb +230 -0
- data/lib/artikcloud/version.rb +1 -1
- data/lib/artikcloud.rb +31 -0
- data/pom.xml +1 -1
- data/spec/api/devices_api_spec.rb +7 -10
- data/spec/api/devices_management_api_spec.rb +251 -0
- data/spec/api/messages_api_spec.rb +67 -25
- data/spec/api/tokens_api_spec.rb +10 -33
- data/spec/api/users_api_spec.rb +65 -14
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/factories/devices.rb +32 -0
- data/spec/factories/users.rb +31 -0
- data/spec/fixtures/cassettes/DevicesApi/get_device_presence_test/should_work.yml +50 -0
- data/spec/fixtures/cassettes/MessagesApi/get_message_snapshots/should_work.yml +54 -0
- data/spec/fixtures/cassettes/MessagesApi/send_actions/should_work.yml +93 -0
- data/spec/fixtures/cassettes/MessagesApi/send_message_action_test/should_work.yml +99 -0
- data/spec/fixtures/cassettes/TokensApi/refresh_token_test/should_work.yml +43 -0
- data/spec/fixtures/cassettes/TokensApi/token_info_test/should_work.yml +38 -0
- data/spec/fixtures/cassettes/UsersApi/get_self_test/should_work.yml +53 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_device_types_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_devices_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_properties_update_user_properties_and_delete_user_properties_test/should_work.yml +52 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_rules_test/should_work.yml +58 -0
- data/spec/spec_helper.rb +20 -5
- metadata +142 -46
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/messages/snapshots?sdids=19da42ee01414722a6ad1224097c38d4
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Request-Time:
|
30
|
+
- '0.045'
|
31
|
+
X-Rate-Limit-Limit:
|
32
|
+
- 100/1000
|
33
|
+
X-Rate-Limit-Reset:
|
34
|
+
- 1472793369/1472860800
|
35
|
+
X-Rate-Limit-Remaining:
|
36
|
+
- 99/999
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
Access-Control-Allow-Headers:
|
40
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
41
|
+
Access-Control-Allow-Methods:
|
42
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
43
|
+
Date:
|
44
|
+
- Fri, 02 Sep 2016 05:15:09 GMT
|
45
|
+
Content-Length:
|
46
|
+
- '204'
|
47
|
+
Connection:
|
48
|
+
- close
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"sdids":"19da42ee01414722a6ad1224097c38d4","size":1,"data":[{"sdid":"19da42ee01414722a6ad1224097c38d4","data":{"distance":{"ts":1472249671454,"value":850.745},"steps":{"ts":1472792594163,"value":500}}}]}'
|
52
|
+
http_version:
|
53
|
+
recorded_at: Fri, 02 Sep 2016 05:15:09 GMT
|
54
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,93 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.artik.cloud/v1.1/actions
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"data":{"actions":[{"name":"setVolume","parameters":{"volume":5}}]},"ddid":"5c97745b1e7a4beb96edd583ad595884","ts":1472794753437.731,"type":"action"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
X-Rate-Limit-Limit:
|
26
|
+
- 100/100000
|
27
|
+
X-Rate-Limit-Remaining:
|
28
|
+
- 99/99996
|
29
|
+
X-Rate-Limit-Reset:
|
30
|
+
- 1472794814/1472860800
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Content-Length:
|
34
|
+
- '51'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: '{"data":{"mid":"7d188d6e15f44a1286b3d392aceac5a5"}}'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Fri, 02 Sep 2016 05:39:14 GMT
|
42
|
+
- request:
|
43
|
+
method: get
|
44
|
+
uri: https://api.artik.cloud/v1.1/actions?mid=7d188d6e15f44a1286b3d392aceac5a5
|
45
|
+
body:
|
46
|
+
encoding: US-ASCII
|
47
|
+
string: ''
|
48
|
+
headers:
|
49
|
+
User-Agent:
|
50
|
+
- Swagger-Codegen/2.0.5/ruby
|
51
|
+
Content-Type:
|
52
|
+
- application/json
|
53
|
+
Accept:
|
54
|
+
- application/json
|
55
|
+
Authorization:
|
56
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
57
|
+
Expect:
|
58
|
+
- ''
|
59
|
+
response:
|
60
|
+
status:
|
61
|
+
code: 200
|
62
|
+
message: OK
|
63
|
+
headers:
|
64
|
+
Allow:
|
65
|
+
- "*"
|
66
|
+
Content-Type:
|
67
|
+
- application/json
|
68
|
+
Request-Time:
|
69
|
+
- '0.06'
|
70
|
+
X-Rate-Limit-Limit:
|
71
|
+
- 100/1000
|
72
|
+
X-Rate-Limit-Reset:
|
73
|
+
- 1472794817/1472860800
|
74
|
+
X-Rate-Limit-Remaining:
|
75
|
+
- 99/996
|
76
|
+
Access-Control-Allow-Origin:
|
77
|
+
- "*"
|
78
|
+
Access-Control-Allow-Headers:
|
79
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
80
|
+
Access-Control-Allow-Methods:
|
81
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
82
|
+
Date:
|
83
|
+
- Fri, 02 Sep 2016 05:39:17 GMT
|
84
|
+
Content-Length:
|
85
|
+
- '470'
|
86
|
+
Connection:
|
87
|
+
- close
|
88
|
+
body:
|
89
|
+
encoding: UTF-8
|
90
|
+
string: '{"mid":"7d188d6e15f44a1286b3d392aceac5a5","uid":"04ddbd35d57d4d7b8f07f219c44457b2","count":100,"order":"asc","size":1,"data":[{"type":"action","cts":1472794754627,"ts":1472794753437,"mid":"7d188d6e15f44a1286b3d392aceac5a5","sdid":"5c97745b1e7a4beb96edd583ad595884","ddid":"5c97745b1e7a4beb96edd583ad595884","data":{"actions":[{"name":"setVolume","parameters":{"volume":5}}]},"ddtid":"dt8399fcebc37e44658a5b00495b61ec9d","uid":"04ddbd35d57d4d7b8f07f219c44457b2","mv":7}]}'
|
91
|
+
http_version:
|
92
|
+
recorded_at: Fri, 02 Sep 2016 05:39:17 GMT
|
93
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,99 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.artik.cloud/v1.1/messages
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"data":{"steps":500},"sdid":"19da42ee01414722a6ad1224097c38d4","ts":1472709681896.5461,"type":"message"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer dc43d12e2b59495daf94631e6ddfe3e8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
X-Quota-Reset:
|
26
|
+
- 1472688000/1472774400
|
27
|
+
X-Rate-Limit-Limit:
|
28
|
+
- 100/100000
|
29
|
+
X-Quota-Max-Payload-Size:
|
30
|
+
- '1024'
|
31
|
+
X-Rate-Limit-Remaining:
|
32
|
+
- 98/99973
|
33
|
+
X-Rate-Limit-Reset:
|
34
|
+
- 1472709713/1472774400
|
35
|
+
Content-Type:
|
36
|
+
- application/json
|
37
|
+
X-Quota-Daily-Messages:
|
38
|
+
- 27/150
|
39
|
+
Content-Length:
|
40
|
+
- '51'
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"data":{"mid":"ff7cd85bfeb041be831b201c3e4ca2d1"}}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Thu, 01 Sep 2016 06:01:24 GMT
|
48
|
+
- request:
|
49
|
+
method: get
|
50
|
+
uri: https://api.artik.cloud/v1.1/messages?mid=ff7cd85bfeb041be831b201c3e4ca2d1
|
51
|
+
body:
|
52
|
+
encoding: US-ASCII
|
53
|
+
string: ''
|
54
|
+
headers:
|
55
|
+
User-Agent:
|
56
|
+
- Swagger-Codegen/2.0.5/ruby
|
57
|
+
Content-Type:
|
58
|
+
- application/json
|
59
|
+
Accept:
|
60
|
+
- application/json
|
61
|
+
Authorization:
|
62
|
+
- Bearer dc43d12e2b59495daf94631e6ddfe3e8
|
63
|
+
Expect:
|
64
|
+
- ''
|
65
|
+
response:
|
66
|
+
status:
|
67
|
+
code: 200
|
68
|
+
message: OK
|
69
|
+
headers:
|
70
|
+
Allow:
|
71
|
+
- "*"
|
72
|
+
Content-Type:
|
73
|
+
- application/json
|
74
|
+
Request-Time:
|
75
|
+
- '0.155'
|
76
|
+
X-Rate-Limit-Limit:
|
77
|
+
- 100/1000
|
78
|
+
X-Rate-Limit-Reset:
|
79
|
+
- 1472709716/1472774400
|
80
|
+
X-Rate-Limit-Remaining:
|
81
|
+
- 98/974
|
82
|
+
Access-Control-Allow-Origin:
|
83
|
+
- "*"
|
84
|
+
Access-Control-Allow-Headers:
|
85
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
86
|
+
Access-Control-Allow-Methods:
|
87
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
88
|
+
Date:
|
89
|
+
- Thu, 01 Sep 2016 06:01:27 GMT
|
90
|
+
Content-Length:
|
91
|
+
- '407'
|
92
|
+
Connection:
|
93
|
+
- close
|
94
|
+
body:
|
95
|
+
encoding: UTF-8
|
96
|
+
string: '{"mid":"ff7cd85bfeb041be831b201c3e4ca2d1","uid":"04ddbd35d57d4d7b8f07f219c44457b2","sdid":"19da42ee01414722a6ad1224097c38d4","count":100,"order":"asc","size":1,"data":[{"mid":"ff7cd85bfeb041be831b201c3e4ca2d1","data":{"steps":500},"ts":1472709681896,"sdtid":"dta8ad42083f33441b8677e5b36f049a4b","cts":1472709684079,"uid":"04ddbd35d57d4d7b8f07f219c44457b2","mv":1,"sdid":"19da42ee01414722a6ad1224097c38d4"}]}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Thu, 01 Sep 2016 06:01:27 GMT
|
99
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,43 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.artik.cloud/v1.1/accounts/token
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: grant_type=refresh_token&refresh_token=bb90333ae
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 400
|
23
|
+
message: Bad Request
|
24
|
+
headers:
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Cache-Control:
|
30
|
+
- no-store
|
31
|
+
Date:
|
32
|
+
- Thu, 01 Sep 2016 05:47:23 GMT
|
33
|
+
Content-Length:
|
34
|
+
- '88'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
body:
|
38
|
+
encoding: UTF-8
|
39
|
+
string: '{"error":{"code":"invalid_request","message":"This API works only with
|
40
|
+
implicit apps."}}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Thu, 01 Sep 2016 05:47:23 GMT
|
43
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/accounts/tokenInfo
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Date:
|
28
|
+
- Wed, 31 Aug 2016 04:11:54 GMT
|
29
|
+
Content-Length:
|
30
|
+
- '122'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"data":{"user_id":"04ddbd35d57d4d7b8f07f219c44457b2","client_id":"b6951bf387b84f63b38911ae35d65e28","expires_in":224617}}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 31 Aug 2016 04:11:54 GMT
|
38
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/users/self
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
X-Rate-Limit-Limit:
|
30
|
+
- 100/1000
|
31
|
+
X-Rate-Limit-Reset:
|
32
|
+
- 1472706031/1472774400
|
33
|
+
X-Rate-Limit-Remaining:
|
34
|
+
- 99/950
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
39
|
+
Access-Control-Allow-Methods:
|
40
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
41
|
+
Date:
|
42
|
+
- Thu, 01 Sep 2016 04:59:31 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '235'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"data":{"id":"04ddbd35d57d4d7b8f07f219c44457b2","name":"maneesh","email":"maneesh.sahu@ssi.samsung.com","fullName":"Maneesh
|
50
|
+
Sahu","saIdentity":"kqil5l7kgb","accountType":"SAMSUNG","createdOn":1406839290000,"modifiedOn":1413483926000}}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Thu, 01 Sep 2016 04:59:32 GMT
|
53
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/users/04ddbd35d57d4d7b8f07f219c44457b2/devicetypes
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
X-Rate-Limit-Limit:
|
30
|
+
- 100/1000
|
31
|
+
X-Rate-Limit-Reset:
|
32
|
+
- 1472706031/1472774400
|
33
|
+
X-Rate-Limit-Remaining:
|
34
|
+
- 97/948
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
39
|
+
Access-Control-Allow-Methods:
|
40
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
41
|
+
Date:
|
42
|
+
- Thu, 01 Sep 2016 04:59:33 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '3947'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"data":{"deviceTypes":[{"id":"dt9f44d55592654d0fab2e8b15259471ea","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"CloudDeviceType","published":false,"approved":false,"protected":true,"latestVersion":0,"uniqueName":"io.samsungsami.cloud.testdt","vid":"0","rsp":false,"issuerDn":null,"description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8Ff3ISYJKVVxpG","lastUpdated":1460399175000},{"id":"dtb9ac6a046cc743feb65a793f1b84ab78","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"Custom
|
50
|
+
Expensive Device Type","published":true,"approved":true,"protected":true,"latestVersion":1,"uniqueName":"cloud.artik.custom.expensivedevicetype","vid":"0","rsp":false,"issuerDn":null,"description":"Has
|
51
|
+
a bunch of test information to share with the world","tags":[{"name":"automotive","isCategory":true},{"name":"car","isCategory":false},{"name":"caprese","isCategory":false},{"name":"management","isCategory":false}],"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8Ff475JF1UvuPz","lastUpdated":1461766419000},{"id":"dtc70e7c8934ed4d0abebdb23d23469eab","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"DMPedometer","published":false,"approved":true,"protected":true,"latestVersion":1,"uniqueName":"cloud.artik.dm.pedometer","vid":"0","rsp":false,"issuerDn":null,"description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8gJfVqrvB5YUjf","lastUpdated":1466546886000},{"id":"dta8ad42083f33441b8677e5b36f049a4b","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"MyPedoMeter","published":true,"approved":true,"protected":true,"latestVersion":1,"uniqueName":"com.samsung.ssic.mypedometer","vid":"0","rsp":false,"issuerDn":null,"description":"Simple
|
52
|
+
Pedometer Device Type that tracks steps and distance","tags":[{"name":"health","isCategory":true},{"name":"running","isCategory":false},{"name":"sensors","isCategory":false}],"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8Ff8uoCj554MKu","lastUpdated":1461766424000},{"id":"dt0426f45704ac42eda15175b1e59a52b6","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"SecurePedometer","published":true,"approved":true,"protected":true,"latestVersion":1,"uniqueName":"securepedometer","vid":"0","rsp":true,"issuerDn":"67789a5fd43ad852a28c286f43939a37","description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8FfBZJ6cHPCgUU","lastUpdated":1461766428000},{"id":"dt960d1f84e44c4404b43a1c9493cdbb19","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"testac","published":false,"approved":false,"protected":true,"latestVersion":1,"uniqueName":"com.samsung.sami.testshac2","vid":"0","rsp":false,"issuerDn":null,"description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8FfJLDCI2XU4Vl","lastUpdated":1460400096000},{"id":"dte364dce0512142dfb1733329b82a5a5d","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"TestAirConditioner","published":false,"approved":true,"protected":true,"latestVersion":1,"uniqueName":"com.samsungtest.testairconditioner","vid":"0","rsp":false,"issuerDn":null,"description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8FfJGosIMF6ii7","lastUpdated":1460400097000},{"id":"dt8399fcebc37e44658a5b00495b61ec9d","oid":"a2c153df2b7c4f31bcf79dd2aec157dd","uid":"04ddbd35d57d4d7b8f07f219c44457b2","name":"TizenTV","published":false,"approved":true,"protected":true,"latestVersion":7,"uniqueName":"io.samsungsami.tizentv","vid":"0","rsp":false,"issuerDn":null,"description":null,"inStore":false,"hasCloudConnector":false,"billingSubscriptionId":"sub_8FfKEYeJAH1kXH","lastUpdated":1460400153000}]},"total":8,"offset":0,"count":8}'
|
53
|
+
http_version:
|
54
|
+
recorded_at: Thu, 01 Sep 2016 04:59:33 GMT
|
55
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/users/04ddbd35d57d4d7b8f07f219c44457b2/devices
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
X-Rate-Limit-Limit:
|
30
|
+
- 100/1000
|
31
|
+
X-Rate-Limit-Reset:
|
32
|
+
- 1472706031/1472774400
|
33
|
+
X-Rate-Limit-Remaining:
|
34
|
+
- 98/949
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
39
|
+
Access-Control-Allow-Methods:
|
40
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
41
|
+
Date:
|
42
|
+
- Thu, 01 Sep 2016 04:59:32 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '3868'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"data":{"devices":[{"id":"1340f16ae1614c3194d04282b10da588","dtid":"dtc70e7c8934ed4d0abebdb23d23469eab","name":"DMPedometer1","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1472509051000,"connected":true},{"id":"ebc10fcfe71048f1b7a07ea16604fb0c","dtid":"dt548080e90be144f080ce28b26be62929","name":"dt548080e90be144f080ce28b26be62929","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"AUTHORIZED","createdOn":1460580896000,"connected":true},{"id":"d660278e6f044a57986bb0f79d364e7f","dtid":"dt8e71cabde68b4028b106832247cd6d72","name":"dt8e71cabde68b4028b106832247cd6d72","manifestVersion":8,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"AUTHORIZED","createdOn":1460581499000,"connected":true},{"id":"db297fc94e3a4e609150806dbd23be12","dtid":"dt9ad7ecfd34324765a9b12ef98a51b29e","name":"dt9ad7ecfd34324765a9b12ef98a51b29e","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1461713067000,"connected":true},{"id":"16f54be9b9ce4c69be14a6c8ff33ea8d","dtid":"dta8ad42083f33441b8677e5b36f049a4b","name":"dta8ad42083f33441b8677e5b36f049a4b","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1461713066000,"connected":true},{"id":"56e7961fff174920bcbcc1783083b2aa","dtid":"sami_gear_fit","name":"MSPedometer","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1472512058000,"connected":true},{"id":"650168ebd77f467ab520011466ae36ba","dtid":"dta8ad42083f33441b8677e5b36f049a4b","name":"MyPedoMeter2","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1464723603000,"connected":true},{"id":"23a9f6d62d7246a893e66ad6f79fc8da","dtid":"dta8ad42083f33441b8677e5b36f049a4b","name":"MyPedoMeter2","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1464723625000,"connected":true},{"id":"19da42ee01414722a6ad1224097c38d4","dtid":"dta8ad42083f33441b8677e5b36f049a4b","name":"MyPedoMeter2","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1464723620000,"connected":true},{"id":"f4c87a1c0fe54a5caffcc19b25a8502d","dtid":"dtfa43cc4901e24208976cdcc75c190188","name":"SAMI
|
50
|
+
Example IoT DIY Sensor","manifestVersion":3,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1464720244000,"connected":true},{"id":"5c97745b1e7a4beb96edd583ad595884","dtid":"dt8399fcebc37e44658a5b00495b61ec9d","name":"TizenTV1","manifestVersion":7,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1471990707000,"connected":true},{"id":"3dd34bce025a4409ac1ff80be81b8dbc","dtid":"vitalconnect_module","name":"Vital
|
51
|
+
Connect Module","manifestVersion":1,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"NO_AUTHORIZATION","createdOn":1464372417000,"connected":true},{"id":"7d7c13c66367427886c219364fdf5bae","dtid":"dt29673f0481b4401bb73a622353b96150","name":"Withings
|
52
|
+
Device","manifestVersion":5,"manifestVersionPolicy":"LATEST","needProviderAuth":false,"cloudAuthorization":"AUTHORIZED","createdOn":1460418313000,"connected":true},{"id":"5f1d6d85ad0141f3b9a07f0107dbd704","dtid":"dt29673f0481b4401bb73a622353b96150","name":"Withings2","manifestVersion":5,"manifestVersionPolicy":"LATEST","needProviderAuth":true,"cloudAuthorization":"UNAUTHORIZED","createdOn":1464207328000,"connected":true}]},"total":14,"offset":0,"count":14}'
|
53
|
+
http_version:
|
54
|
+
recorded_at: Thu, 01 Sep 2016 04:59:32 GMT
|
55
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/users/04ddbd35d57d4d7b8f07f219c44457b2/properties?aid=b6951bf387b84f63b38911ae35d65e28
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
X-Rate-Limit-Limit:
|
30
|
+
- 100/1000
|
31
|
+
X-Rate-Limit-Reset:
|
32
|
+
- 1472706031/1472774400
|
33
|
+
X-Rate-Limit-Remaining:
|
34
|
+
- 96/947
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
39
|
+
Access-Control-Allow-Methods:
|
40
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
41
|
+
Date:
|
42
|
+
- Thu, 01 Sep 2016 04:59:34 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '115'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"data":{"uid":"04ddbd35d57d4d7b8f07f219c44457b2","aid":"b6951bf387b84f63b38911ae35d65e28","properties":"mno=pqr"}}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Thu, 01 Sep 2016 04:59:34 GMT
|
52
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.artik.cloud/v1.1/users/04ddbd35d57d4d7b8f07f219c44457b2/rules
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Swagger-Codegen/2.0.5/ruby
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Accept:
|
15
|
+
- application/json
|
16
|
+
Authorization:
|
17
|
+
- Bearer fa460261b858484583097ecb331faaa8
|
18
|
+
Expect:
|
19
|
+
- ''
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Allow:
|
26
|
+
- "*"
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
X-Rate-Limit-Limit:
|
30
|
+
- 100/1000
|
31
|
+
X-Rate-Limit-Reset:
|
32
|
+
- 1472706034/1472774400
|
33
|
+
X-Rate-Limit-Remaining:
|
34
|
+
- 99/998
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, Authorization
|
39
|
+
Access-Control-Allow-Methods:
|
40
|
+
- POST, GET, PUT, DELETE, OPTIONS
|
41
|
+
Date:
|
42
|
+
- Thu, 01 Sep 2016 04:59:34 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '1053'
|
45
|
+
Connection:
|
46
|
+
- close
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"total":1,"offset":0,"count":1,"data":[{"uid":"04ddbd35d57d4d7b8f07f219c44457b2","id":"b00ae40f52cd41faa0c402cf1ffbc83f","aid":"b6951bf387b84f63b38911ae35d65e28","name":"ABC","languageVersion":1,"rule":{"if":{"and":[{"sdid":"deea2ca077b94d2db337722e28b41287","field":"stepCount","operator":"<=","operand":{"value":80}},{"sdid":"510029a262524bcc909363e750bf945e","field":"weight","operator":"is
|
50
|
+
in message"}]},"then":[{"ddid":"993925c3cd994bf7a51c620884be65e9","action":"setText","parameters":{"text":{"value":"Uh-oh"}}}]},"enabled":true,"index":0,"createdOn":1457466383313,"modifiedOn":1457466383313,"isTestable":false,"description":"My
|
51
|
+
Name","invalidatedOn":1460418141979,"error":{"code":4001,"message":"Validation
|
52
|
+
Error","errors":[[{"field":"rule.if.and.0.sdid","messages":["Device \"deea2ca077b94d2db337722e28b41287\"
|
53
|
+
does not exist"]},{"field":"rule.if.and.1.sdid","messages":["Device \"510029a262524bcc909363e750bf945e\"
|
54
|
+
does not exist"]},{"field":"rule.then.0.ddid","messages":["Device \"993925c3cd994bf7a51c620884be65e9\"
|
55
|
+
does not exist"]}]]}}]}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Thu, 01 Sep 2016 04:59:34 GMT
|
58
|
+
recorded_with: VCR 3.0.3
|
data/spec/spec_helper.rb
CHANGED
@@ -5,18 +5,32 @@ require 'vcr'
|
|
5
5
|
require 'typhoeus'
|
6
6
|
require 'json'
|
7
7
|
require 'yaml'
|
8
|
+
require 'factory_girl'
|
8
9
|
require 'rspec'
|
10
|
+
require 'pry'
|
11
|
+
|
12
|
+
VCR.configure do |config|
|
13
|
+
config.cassette_library_dir = "spec/fixtures/cassettes"
|
14
|
+
config.hook_into :webmock # or :fakeweb
|
15
|
+
config.configure_rspec_metadata!
|
16
|
+
end
|
9
17
|
|
10
18
|
RSpec.configure do |config|
|
11
19
|
# some (optional) config here
|
20
|
+
config.include FactoryGirl::Syntax::Methods
|
21
|
+
|
12
22
|
config.expect_with :rspec do |c|
|
13
|
-
c.syntax = :
|
23
|
+
c.syntax = :expect
|
14
24
|
end
|
25
|
+
|
15
26
|
config.mock_with :rspec do |c|
|
16
|
-
c.syntax = :
|
27
|
+
c.syntax = :expect
|
17
28
|
end
|
18
|
-
end
|
19
29
|
|
30
|
+
config.before(:suite) do
|
31
|
+
FactoryGirl.find_definitions
|
32
|
+
end
|
33
|
+
end
|
20
34
|
|
21
35
|
WebMock.allow_net_connect! if defined? WebMock
|
22
36
|
|
@@ -25,12 +39,13 @@ def help
|
|
25
39
|
exit
|
26
40
|
end
|
27
41
|
|
28
|
-
def prepare_api_client
|
42
|
+
def prepare_api_client
|
29
43
|
configuration = ArtikCloud::Configuration.new
|
30
|
-
configuration.access_token =
|
44
|
+
configuration.access_token = ACCESS_TOKEN
|
31
45
|
configuration.debugging = false
|
32
46
|
api_client = ArtikCloud::ApiClient.new(configuration)
|
33
47
|
return api_client
|
34
48
|
end
|
35
49
|
|
50
|
+
ACCESS_TOKEN = 'fa460261b858484583097ecb331faaa8'
|
36
51
|
API_CLIENT = prepare_api_client
|