leancloud-ruby-client 0.1.0

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 (99) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +9 -0
  3. data/Gemfile +16 -0
  4. data/Gemfile.lock +86 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +1177 -0
  7. data/Rakefile +45 -0
  8. data/VERSION +1 -0
  9. data/example.rb +35 -0
  10. data/features.md +1111 -0
  11. data/fixtures/vcr_cassettes/test_acls_arent_objects.yml +274 -0
  12. data/fixtures/vcr_cassettes/test_array_add.yml +213 -0
  13. data/fixtures/vcr_cassettes/test_array_add_pointerizing.yml +380 -0
  14. data/fixtures/vcr_cassettes/test_array_add_unique.yml +319 -0
  15. data/fixtures/vcr_cassettes/test_batch_create_object.yml +107 -0
  16. data/fixtures/vcr_cassettes/test_batch_delete_object.yml +637 -0
  17. data/fixtures/vcr_cassettes/test_batch_run.yml +109 -0
  18. data/fixtures/vcr_cassettes/test_batch_update_nils_delete_keys.yml +435 -0
  19. data/fixtures/vcr_cassettes/test_batch_update_object.yml +637 -0
  20. data/fixtures/vcr_cassettes/test_contains_all.yml +1143 -0
  21. data/fixtures/vcr_cassettes/test_cql.yml +99 -0
  22. data/fixtures/vcr_cassettes/test_created_at.yml +109 -0
  23. data/fixtures/vcr_cassettes/test_decrement.yml +213 -0
  24. data/fixtures/vcr_cassettes/test_deep_parse.yml +321 -0
  25. data/fixtures/vcr_cassettes/test_destroy.yml +213 -0
  26. data/fixtures/vcr_cassettes/test_empty_response.yml +1026 -0
  27. data/fixtures/vcr_cassettes/test_eq_pointerize.yml +427 -0
  28. data/fixtures/vcr_cassettes/test_equality.yml +321 -0
  29. data/fixtures/vcr_cassettes/test_get.yml +215 -0
  30. data/fixtures/vcr_cassettes/test_get_installation.yml +58 -0
  31. data/fixtures/vcr_cassettes/test_get_missing.yml +160 -0
  32. data/fixtures/vcr_cassettes/test_image_file_associate_with_object.yml +2089 -0
  33. data/fixtures/vcr_cassettes/test_image_file_save.yml +1928 -0
  34. data/fixtures/vcr_cassettes/test_include.yml +321 -0
  35. data/fixtures/vcr_cassettes/test_new_model.yml +109 -0
  36. data/fixtures/vcr_cassettes/test_new_object.yml +109 -0
  37. data/fixtures/vcr_cassettes/test_nils_delete_keys.yml +319 -0
  38. data/fixtures/vcr_cassettes/test_object_id.yml +56 -0
  39. data/fixtures/vcr_cassettes/test_parse_delete.yml +421 -0
  40. data/fixtures/vcr_cassettes/test_pointer.yml +109 -0
  41. data/fixtures/vcr_cassettes/test_request_sms.yml +48 -0
  42. data/fixtures/vcr_cassettes/test_reset_password.yml +109 -0
  43. data/fixtures/vcr_cassettes/test_retries.yml +4173 -0
  44. data/fixtures/vcr_cassettes/test_retries_404.yml +1026 -0
  45. data/fixtures/vcr_cassettes/test_retries_404_correct.yml +1026 -0
  46. data/fixtures/vcr_cassettes/test_retries_json_error.yml +2265 -0
  47. data/fixtures/vcr_cassettes/test_retries_server_error.yml +2265 -0
  48. data/fixtures/vcr_cassettes/test_save_installation.yml +58 -0
  49. data/fixtures/vcr_cassettes/test_save_with_sub_objects.yml +484 -0
  50. data/fixtures/vcr_cassettes/test_saving_boolean_values.yml +215 -0
  51. data/fixtures/vcr_cassettes/test_saving_nested_objects.yml +62 -0
  52. data/fixtures/vcr_cassettes/test_server_update.yml +586 -0
  53. data/fixtures/vcr_cassettes/test_simple_save.yml +109 -0
  54. data/fixtures/vcr_cassettes/test_text_file_save.yml +109 -0
  55. data/fixtures/vcr_cassettes/test_update.yml +213 -0
  56. data/fixtures/vcr_cassettes/test_updated_at.yml +213 -0
  57. data/fixtures/vcr_cassettes/test_user_login.yml +276 -0
  58. data/fixtures/vcr_cassettes/test_user_save.yml +109 -0
  59. data/fixtures/vcr_cassettes/test_xget.yml +603 -0
  60. data/leancloud-ruby-client.gemspec +166 -0
  61. data/lib/faraday/better_retry.rb +94 -0
  62. data/lib/faraday/extended_parse_json.rb +39 -0
  63. data/lib/faraday/get_method_override.rb +32 -0
  64. data/lib/leancloud-ruby-client.rb +34 -0
  65. data/lib/leancloud/application.rb +7 -0
  66. data/lib/leancloud/batch.rb +53 -0
  67. data/lib/leancloud/client.rb +149 -0
  68. data/lib/leancloud/cloud.rb +28 -0
  69. data/lib/leancloud/datatypes.rb +355 -0
  70. data/lib/leancloud/error.rb +42 -0
  71. data/lib/leancloud/installation.rb +57 -0
  72. data/lib/leancloud/model.rb +14 -0
  73. data/lib/leancloud/object.rb +252 -0
  74. data/lib/leancloud/protocol.rb +193 -0
  75. data/lib/leancloud/push.rb +48 -0
  76. data/lib/leancloud/query.rb +194 -0
  77. data/lib/leancloud/user.rb +38 -0
  78. data/lib/leancloud/util.rb +93 -0
  79. data/test/cloud_functions/MyCloudCode/cloud/main.js +4 -0
  80. data/test/config/global.json +14 -0
  81. data/test/helper.rb +108 -0
  82. data/test/middleware/better_retry_test.rb +57 -0
  83. data/test/middleware/extend_parse_json_test.rb +55 -0
  84. data/test/parsers.jpg +0 -0
  85. data/test/test_batch.rb +132 -0
  86. data/test/test_client.rb +183 -0
  87. data/test/test_cloud.rb +31 -0
  88. data/test/test_datatypes.rb +105 -0
  89. data/test/test_file.rb +67 -0
  90. data/test/test_init.rb +23 -0
  91. data/test/test_init_from_cloud_code.rb +8 -0
  92. data/test/test_installation.rb +49 -0
  93. data/test/test_model.rb +22 -0
  94. data/test/test_object.rb +295 -0
  95. data/test/test_push.rb +45 -0
  96. data/test/test_query.rb +198 -0
  97. data/test/test_throttle.rb +5 -0
  98. data/test/test_user.rb +60 -0
  99. metadata +298 -0
@@ -0,0 +1,215 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.parse.com/1/classes/Post
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"read":false,"published":true}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Parse for Ruby, 0.0
16
+ X-Parse-Master-Key:
17
+ - ''
18
+ X-Parse-Rest-Api-Key:
19
+ - <X-Parse-REST-API-Key>
20
+ X-Parse-Application-Id:
21
+ - <X-Parse-Application-Id>
22
+ X-Parse-Session-Token:
23
+ - ''
24
+ Expect:
25
+ - ''
26
+ response:
27
+ status:
28
+ code: 201
29
+ message: Created
30
+ headers:
31
+ Access-Control-Allow-Origin:
32
+ - '*'
33
+ Access-Control-Request-Method:
34
+ - '*'
35
+ Cache-Control:
36
+ - no-cache
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Date:
40
+ - Tue, 23 Apr 2013 19:00:13 GMT
41
+ Location:
42
+ - https://api.parse.com/1/classes/Post/Gz18MFpKTf
43
+ Server:
44
+ - nginx/1.2.2
45
+ Set-Cookie:
46
+ - <COOKIE-KEY>
47
+ Status:
48
+ - 201 Created
49
+ X-Runtime:
50
+ - '0.040490'
51
+ X-Ua-Compatible:
52
+ - IE=Edge,chrome=1
53
+ Content-Length:
54
+ - '64'
55
+ Connection:
56
+ - keep-alive
57
+ body:
58
+ encoding: ASCII-8BIT
59
+ string: '{"createdAt":"2013-04-23T19:00:13.926Z","objectId":"Gz18MFpKTf"}'
60
+ http_version:
61
+ recorded_at: Tue, 23 Apr 2013 19:00:13 GMT
62
+ - request:
63
+ method: get
64
+ uri: https://api.parse.com/1/classes/Post?where=%7B%22objectId%22:%22Gz18MFpKTf%22%7D
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ Content-Type:
70
+ - application/json
71
+ Accept:
72
+ - application/json
73
+ User-Agent:
74
+ - Parse for Ruby, 0.0
75
+ X-Parse-Master-Key:
76
+ - ''
77
+ X-Parse-Rest-Api-Key:
78
+ - <X-Parse-REST-API-Key>
79
+ X-Parse-Application-Id:
80
+ - <X-Parse-Application-Id>
81
+ X-Parse-Session-Token:
82
+ - ''
83
+ Expect:
84
+ - ''
85
+ response:
86
+ status:
87
+ code: 200
88
+ message: OK
89
+ headers:
90
+ Access-Control-Allow-Origin:
91
+ - '*'
92
+ Access-Control-Request-Method:
93
+ - '*'
94
+ Cache-Control:
95
+ - max-age=0, private, must-revalidate
96
+ Content-Type:
97
+ - application/json; charset=utf-8
98
+ Date:
99
+ - Tue, 23 Apr 2013 19:00:41 GMT
100
+ Etag:
101
+ - '"f0b18c76d2bf8fac854f1de08cbe253b"'
102
+ Server:
103
+ - nginx/1.2.2
104
+ Set-Cookie:
105
+ - <COOKIE-KEY>
106
+ Status:
107
+ - 200 OK
108
+ X-Runtime:
109
+ - '0.035832'
110
+ X-Ua-Compatible:
111
+ - IE=Edge,chrome=1
112
+ Content-Length:
113
+ - '147'
114
+ Connection:
115
+ - keep-alive
116
+ body:
117
+ encoding: ASCII-8BIT
118
+ string: '{"results":[{"read":false,"published":true,"createdAt":"2013-04-23T19:00:13.926Z","updatedAt":"2013-04-23T19:00:13.926Z","objectId":"Gz18MFpKTf"}]}'
119
+ http_version:
120
+ recorded_at: Tue, 23 Apr 2013 19:00:41 GMT
121
+ - request:
122
+ method: post
123
+ uri: https://api.leancloud.cn/1.1/classes/Post
124
+ body:
125
+ encoding: UTF-8
126
+ string: '{"read":false,"published":true}'
127
+ headers:
128
+ User-Agent:
129
+ - Parse for Ruby, 0.0
130
+ Content-Type:
131
+ - application/json
132
+ X-Avoscloud-Application-Id:
133
+ - <X-AVOSCloud-Application-Id>
134
+ X-Avoscloud-Application-Key:
135
+ - <X-AVOSCloud-Application-Key>
136
+ Accept-Encoding:
137
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
138
+ Accept:
139
+ - '*/*'
140
+ response:
141
+ status:
142
+ code: 201
143
+ message: Created
144
+ headers:
145
+ Server:
146
+ - Tengine
147
+ Date:
148
+ - Fri, 10 Apr 2015 09:10:55 GMT
149
+ Content-Type:
150
+ - application/json;charset=utf-8
151
+ Content-Length:
152
+ - '78'
153
+ Connection:
154
+ - keep-alive
155
+ Location:
156
+ - /1.1/classes/Post/5527939fe4b0da2c5defa22c
157
+ Cache-Control:
158
+ - no-cache,no-store
159
+ Pragma:
160
+ - no-cache
161
+ Strict-Transport-Security:
162
+ - max-age=31536000
163
+ body:
164
+ encoding: UTF-8
165
+ string: '{"createdAt":"2015-04-10T09:10:55.059Z","objectId":"5527939fe4b0da2c5defa22c"}'
166
+ http_version:
167
+ recorded_at: Fri, 10 Apr 2015 09:10:55 GMT
168
+ - request:
169
+ method: get
170
+ uri: https://api.leancloud.cn/1.1/classes/Post?where=%7B%22objectId%22:%225527939fe4b0da2c5defa22c%22%7D
171
+ body:
172
+ encoding: US-ASCII
173
+ string: ''
174
+ headers:
175
+ User-Agent:
176
+ - Parse for Ruby, 0.0
177
+ Content-Type:
178
+ - application/json
179
+ X-Avoscloud-Application-Id:
180
+ - <X-AVOSCloud-Application-Id>
181
+ X-Avoscloud-Application-Key:
182
+ - <X-AVOSCloud-Application-Key>
183
+ Accept-Encoding:
184
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
185
+ Accept:
186
+ - '*/*'
187
+ response:
188
+ status:
189
+ code: 200
190
+ message: OK
191
+ headers:
192
+ Server:
193
+ - Tengine
194
+ Date:
195
+ - Fri, 10 Apr 2015 09:10:55 GMT
196
+ Content-Type:
197
+ - application/json;charset=utf-8
198
+ Content-Length:
199
+ - '161'
200
+ Connection:
201
+ - keep-alive
202
+ Last-Modified:
203
+ - Fri, 10 Apr 2015 09:10:55.060 GMT
204
+ Cache-Control:
205
+ - no-cache,no-store
206
+ Pragma:
207
+ - no-cache
208
+ Strict-Transport-Security:
209
+ - max-age=31536000
210
+ body:
211
+ encoding: UTF-8
212
+ string: '{"results":[{"published":true,"read":false,"createdAt":"2015-04-10T09:10:55.059Z","updatedAt":"2015-04-10T09:10:55.059Z","objectId":"5527939fe4b0da2c5defa22c"}]}'
213
+ http_version:
214
+ recorded_at: Fri, 10 Apr 2015 09:10:55 GMT
215
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.parse.com/1/classes/Post
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"comment":{"__op":"Delete"}}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Parse for Ruby, 0.0
16
+ X-Parse-Master-Key:
17
+ - ''
18
+ X-Parse-Rest-Api-Key:
19
+ - <X-Parse-REST-API-Key>
20
+ X-Parse-Application-Id:
21
+ - <X-Parse-Application-Id>
22
+ X-Parse-Session-Token:
23
+ - ''
24
+ Expect:
25
+ - ''
26
+ response:
27
+ status:
28
+ code: 201
29
+ message: Created
30
+ headers:
31
+ Access-Control-Allow-Origin:
32
+ - '*'
33
+ Access-Control-Request-Method:
34
+ - '*'
35
+ Cache-Control:
36
+ - no-cache
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Date:
40
+ - Wed, 22 May 2013 22:24:06 GMT
41
+ Location:
42
+ - https://api.parse.com/1/classes/Post/lt1txKrs3x
43
+ Server:
44
+ - nginx/1.2.2
45
+ Set-Cookie:
46
+ - <COOKIE-KEY>
47
+ Status:
48
+ - 201 Created
49
+ X-Runtime:
50
+ - '0.035016'
51
+ X-Ua-Compatible:
52
+ - IE=Edge,chrome=1
53
+ Transfer-Encoding:
54
+ - chunked
55
+ Connection:
56
+ - keep-alive
57
+ body:
58
+ encoding: ASCII-8BIT
59
+ string: '{"createdAt":"2013-05-22T22:24:06.104Z","objectId":"lt1txKrs3x"}'
60
+ http_version:
61
+ recorded_at: Wed, 22 May 2013 22:24:06 GMT
62
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,586 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.parse.com/1/classes/TestSave
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Parse for Ruby, 0.0
16
+ X-Parse-Master-Key:
17
+ - ''
18
+ X-Parse-Rest-Api-Key:
19
+ - <X-Parse-REST-API-Key>
20
+ X-Parse-Application-Id:
21
+ - <X-Parse-Application-Id>
22
+ X-Parse-Session-Token:
23
+ - ''
24
+ Expect:
25
+ - ''
26
+ response:
27
+ status:
28
+ code: 201
29
+ message: Created
30
+ headers:
31
+ Access-Control-Allow-Origin:
32
+ - '*'
33
+ Access-Control-Request-Method:
34
+ - '*'
35
+ Cache-Control:
36
+ - no-cache
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Date:
40
+ - Mon, 22 Apr 2013 16:03:14 GMT
41
+ Location:
42
+ - https://api.parse.com/1/classes/TestSave/WSaiWmntLn
43
+ Server:
44
+ - nginx/1.2.2
45
+ Set-Cookie:
46
+ - <COOKIE-KEY>
47
+ Status:
48
+ - 201 Created
49
+ X-Runtime:
50
+ - '0.088257'
51
+ X-Ua-Compatible:
52
+ - IE=Edge,chrome=1
53
+ Content-Length:
54
+ - '64'
55
+ Connection:
56
+ - keep-alive
57
+ body:
58
+ encoding: ASCII-8BIT
59
+ string: '{"createdAt":"2013-04-22T16:03:14.541Z","objectId":"WSaiWmntLn"}'
60
+ http_version:
61
+ recorded_at: Mon, 22 Apr 2013 16:03:14 GMT
62
+ - request:
63
+ method: put
64
+ uri: https://api.parse.com/1/classes/TestSave/WSaiWmntLn
65
+ body:
66
+ encoding: UTF-8
67
+ string: '{"name":"john"}'
68
+ headers:
69
+ Content-Type:
70
+ - application/json
71
+ Accept:
72
+ - application/json
73
+ User-Agent:
74
+ - Parse for Ruby, 0.0
75
+ X-Parse-Master-Key:
76
+ - ''
77
+ X-Parse-Rest-Api-Key:
78
+ - <X-Parse-REST-API-Key>
79
+ X-Parse-Application-Id:
80
+ - <X-Parse-Application-Id>
81
+ X-Parse-Session-Token:
82
+ - ''
83
+ Expect:
84
+ - ''
85
+ response:
86
+ status:
87
+ code: 200
88
+ message: OK
89
+ headers:
90
+ Access-Control-Allow-Origin:
91
+ - '*'
92
+ Access-Control-Request-Method:
93
+ - '*'
94
+ Cache-Control:
95
+ - max-age=0, private, must-revalidate
96
+ Content-Type:
97
+ - application/json; charset=utf-8
98
+ Date:
99
+ - Mon, 22 Apr 2013 16:03:14 GMT
100
+ Etag:
101
+ - '"bd992e9eebd29619aa5c9cc7d685dbc8"'
102
+ Server:
103
+ - nginx/1.2.2
104
+ Set-Cookie:
105
+ - <COOKIE-KEY>
106
+ Status:
107
+ - 200 OK
108
+ X-Runtime:
109
+ - '0.166123'
110
+ X-Ua-Compatible:
111
+ - IE=Edge,chrome=1
112
+ Content-Length:
113
+ - '40'
114
+ Connection:
115
+ - keep-alive
116
+ body:
117
+ encoding: ASCII-8BIT
118
+ string: '{"updatedAt":"2013-04-22T16:03:14.704Z"}'
119
+ http_version:
120
+ recorded_at: Mon, 22 Apr 2013 16:03:14 GMT
121
+ - request:
122
+ method: get
123
+ uri: https://api.parse.com/1/classes/TestSave/WSaiWmntLn
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ''
127
+ headers:
128
+ Content-Type:
129
+ - application/json
130
+ Accept:
131
+ - application/json
132
+ User-Agent:
133
+ - Parse for Ruby, 0.0
134
+ X-Parse-Master-Key:
135
+ - ''
136
+ X-Parse-Rest-Api-Key:
137
+ - <X-Parse-REST-API-Key>
138
+ X-Parse-Application-Id:
139
+ - <X-Parse-Application-Id>
140
+ X-Parse-Session-Token:
141
+ - ''
142
+ Expect:
143
+ - ''
144
+ response:
145
+ status:
146
+ code: 200
147
+ message: OK
148
+ headers:
149
+ Access-Control-Allow-Origin:
150
+ - '*'
151
+ Access-Control-Request-Method:
152
+ - '*'
153
+ Cache-Control:
154
+ - max-age=0, private, must-revalidate
155
+ Content-Type:
156
+ - application/json; charset=utf-8
157
+ Date:
158
+ - Mon, 22 Apr 2013 16:03:14 GMT
159
+ Etag:
160
+ - '"a4170124f997bfd1cd4973881182b7f1"'
161
+ Server:
162
+ - nginx/1.2.2
163
+ Set-Cookie:
164
+ - <COOKIE-KEY>
165
+ Status:
166
+ - 200 OK
167
+ X-Runtime:
168
+ - '0.044724'
169
+ X-Ua-Compatible:
170
+ - IE=Edge,chrome=1
171
+ Content-Length:
172
+ - '117'
173
+ Connection:
174
+ - keep-alive
175
+ body:
176
+ encoding: ASCII-8BIT
177
+ string: '{"name":"john","createdAt":"2013-04-22T16:03:14.541Z","updatedAt":"2013-04-22T16:03:14.704Z","objectId":"WSaiWmntLn"}'
178
+ http_version:
179
+ recorded_at: Mon, 22 Apr 2013 16:03:14 GMT
180
+ - request:
181
+ method: put
182
+ uri: https://api.parse.com/1/classes/TestSave/WSaiWmntLn
183
+ body:
184
+ encoding: UTF-8
185
+ string: '{"name":"dave"}'
186
+ headers:
187
+ Content-Type:
188
+ - application/json
189
+ Accept:
190
+ - application/json
191
+ User-Agent:
192
+ - Parse for Ruby, 0.0
193
+ X-Parse-Master-Key:
194
+ - ''
195
+ X-Parse-Rest-Api-Key:
196
+ - <X-Parse-REST-API-Key>
197
+ X-Parse-Application-Id:
198
+ - <X-Parse-Application-Id>
199
+ X-Parse-Session-Token:
200
+ - ''
201
+ Expect:
202
+ - ''
203
+ response:
204
+ status:
205
+ code: 200
206
+ message: OK
207
+ headers:
208
+ Access-Control-Allow-Origin:
209
+ - '*'
210
+ Access-Control-Request-Method:
211
+ - '*'
212
+ Cache-Control:
213
+ - max-age=0, private, must-revalidate
214
+ Content-Type:
215
+ - application/json; charset=utf-8
216
+ Date:
217
+ - Mon, 22 Apr 2013 16:03:14 GMT
218
+ Etag:
219
+ - '"35dfb8aca4c1ceb9d0814ca6b20bfd0f"'
220
+ Server:
221
+ - nginx/1.2.2
222
+ Set-Cookie:
223
+ - <COOKIE-KEY>
224
+ Status:
225
+ - 200 OK
226
+ X-Runtime:
227
+ - '0.025740'
228
+ X-Ua-Compatible:
229
+ - IE=Edge,chrome=1
230
+ Content-Length:
231
+ - '40'
232
+ Connection:
233
+ - keep-alive
234
+ body:
235
+ encoding: ASCII-8BIT
236
+ string: '{"updatedAt":"2013-04-22T16:03:14.909Z"}'
237
+ http_version:
238
+ recorded_at: Mon, 22 Apr 2013 16:03:14 GMT
239
+ - request:
240
+ method: get
241
+ uri: https://api.parse.com/1/classes/TestSave/WSaiWmntLn
242
+ body:
243
+ encoding: US-ASCII
244
+ string: ''
245
+ headers:
246
+ Content-Type:
247
+ - application/json
248
+ Accept:
249
+ - application/json
250
+ User-Agent:
251
+ - Parse for Ruby, 0.0
252
+ X-Parse-Master-Key:
253
+ - ''
254
+ X-Parse-Rest-Api-Key:
255
+ - <X-Parse-REST-API-Key>
256
+ X-Parse-Application-Id:
257
+ - <X-Parse-Application-Id>
258
+ X-Parse-Session-Token:
259
+ - ''
260
+ Expect:
261
+ - ''
262
+ response:
263
+ status:
264
+ code: 200
265
+ message: OK
266
+ headers:
267
+ Access-Control-Allow-Origin:
268
+ - '*'
269
+ Access-Control-Request-Method:
270
+ - '*'
271
+ Cache-Control:
272
+ - max-age=0, private, must-revalidate
273
+ Content-Type:
274
+ - application/json; charset=utf-8
275
+ Date:
276
+ - Mon, 22 Apr 2013 16:03:14 GMT
277
+ Etag:
278
+ - '"7a8fe3882cc8126112db74f6344750b9"'
279
+ Server:
280
+ - nginx/1.2.2
281
+ Set-Cookie:
282
+ - <COOKIE-KEY>
283
+ Status:
284
+ - 200 OK
285
+ X-Runtime:
286
+ - '0.030711'
287
+ X-Ua-Compatible:
288
+ - IE=Edge,chrome=1
289
+ Content-Length:
290
+ - '117'
291
+ Connection:
292
+ - keep-alive
293
+ body:
294
+ encoding: ASCII-8BIT
295
+ string: '{"name":"dave","createdAt":"2013-04-22T16:03:14.541Z","updatedAt":"2013-04-22T16:03:14.909Z","objectId":"WSaiWmntLn"}'
296
+ http_version:
297
+ recorded_at: Mon, 22 Apr 2013 16:03:14 GMT
298
+ - request:
299
+ method: post
300
+ uri: https://api.parse.com/1/classes/TestSave/WSaiWmntLn
301
+ body:
302
+ encoding: UTF-8
303
+ string: ''
304
+ headers:
305
+ User-Agent:
306
+ - Parse for Ruby, 0.0
307
+ Content-Type:
308
+ - application/json
309
+ X-Parse-Application-Id:
310
+ - <X-Parse-Application-Id>
311
+ X-Parse-Rest-Api-Key:
312
+ - <X-Parse-REST-API-Key>
313
+ X-Http-Method-Override:
314
+ - GET
315
+ Content-Length:
316
+ - '0'
317
+ Accept-Encoding:
318
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
319
+ Accept:
320
+ - '*/*'
321
+ response:
322
+ status:
323
+ code: 404
324
+ message: Not Found
325
+ headers:
326
+ Access-Control-Allow-Origin:
327
+ - '*'
328
+ Access-Control-Request-Method:
329
+ - '*'
330
+ Cache-Control:
331
+ - no-cache
332
+ Content-Type:
333
+ - application/json; charset=utf-8
334
+ Date:
335
+ - Wed, 26 Mar 2014 15:21:15 GMT
336
+ Server:
337
+ - nginx/1.4.4
338
+ Set-Cookie:
339
+ - <COOKIE-KEY>
340
+ Status:
341
+ - 404 Not Found
342
+ X-Runtime:
343
+ - '0.072862'
344
+ X-Ua-Compatible:
345
+ - IE=Edge,chrome=1
346
+ Content-Length:
347
+ - '65'
348
+ Connection:
349
+ - keep-alive
350
+ body:
351
+ encoding: UTF-8
352
+ string: '{"code":101,"error":"object not found for get"}'
353
+ http_version:
354
+ recorded_at: Wed, 26 Mar 2014 15:21:15 GMT
355
+ - request:
356
+ method: post
357
+ uri: https://api.leancloud.cn/1.1/classes/TestSave
358
+ body:
359
+ encoding: UTF-8
360
+ string: '{}'
361
+ headers:
362
+ User-Agent:
363
+ - Parse for Ruby, 0.0
364
+ Content-Type:
365
+ - application/json
366
+ X-Avoscloud-Application-Id:
367
+ - <X-AVOSCloud-Application-Id>
368
+ X-Avoscloud-Application-Key:
369
+ - <X-AVOSCloud-Application-Key>
370
+ Accept-Encoding:
371
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
372
+ Accept:
373
+ - '*/*'
374
+ response:
375
+ status:
376
+ code: 201
377
+ message: Created
378
+ headers:
379
+ Server:
380
+ - Tengine
381
+ Date:
382
+ - Fri, 10 Apr 2015 09:10:38 GMT
383
+ Content-Type:
384
+ - application/json;charset=utf-8
385
+ Content-Length:
386
+ - '78'
387
+ Connection:
388
+ - keep-alive
389
+ Location:
390
+ - /1.1/classes/TestSave/5527938ee4b0da2c5defa157
391
+ Cache-Control:
392
+ - no-cache,no-store
393
+ Pragma:
394
+ - no-cache
395
+ Strict-Transport-Security:
396
+ - max-age=31536000
397
+ body:
398
+ encoding: UTF-8
399
+ string: '{"createdAt":"2015-04-10T09:10:38.361Z","objectId":"5527938ee4b0da2c5defa157"}'
400
+ http_version:
401
+ recorded_at: Fri, 10 Apr 2015 09:10:38 GMT
402
+ - request:
403
+ method: put
404
+ uri: https://api.leancloud.cn/1.1/classes/TestSave/5527938ee4b0da2c5defa157?new=true
405
+ body:
406
+ encoding: UTF-8
407
+ string: '{"name":"john"}'
408
+ headers:
409
+ User-Agent:
410
+ - Parse for Ruby, 0.0
411
+ Content-Type:
412
+ - application/json
413
+ X-Avoscloud-Application-Id:
414
+ - <X-AVOSCloud-Application-Id>
415
+ X-Avoscloud-Application-Key:
416
+ - <X-AVOSCloud-Application-Key>
417
+ Accept-Encoding:
418
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
419
+ Accept:
420
+ - '*/*'
421
+ response:
422
+ status:
423
+ code: 200
424
+ message: OK
425
+ headers:
426
+ Server:
427
+ - Tengine
428
+ Date:
429
+ - Fri, 10 Apr 2015 09:10:38 GMT
430
+ Content-Type:
431
+ - application/json;charset=utf-8
432
+ Content-Length:
433
+ - '92'
434
+ Connection:
435
+ - keep-alive
436
+ Cache-Control:
437
+ - no-cache,no-store
438
+ Pragma:
439
+ - no-cache
440
+ Strict-Transport-Security:
441
+ - max-age=31536000
442
+ body:
443
+ encoding: UTF-8
444
+ string: '{"objectId":"5527938ee4b0da2c5defa157","name":"john","updatedAt":"2015-04-10T09:10:38.643Z"}'
445
+ http_version:
446
+ recorded_at: Fri, 10 Apr 2015 09:10:38 GMT
447
+ - request:
448
+ method: get
449
+ uri: https://api.leancloud.cn/1.1/classes/TestSave/5527938ee4b0da2c5defa157
450
+ body:
451
+ encoding: US-ASCII
452
+ string: ''
453
+ headers:
454
+ User-Agent:
455
+ - Parse for Ruby, 0.0
456
+ Content-Type:
457
+ - application/json
458
+ X-Avoscloud-Application-Id:
459
+ - <X-AVOSCloud-Application-Id>
460
+ X-Avoscloud-Application-Key:
461
+ - <X-AVOSCloud-Application-Key>
462
+ Accept-Encoding:
463
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
464
+ Accept:
465
+ - '*/*'
466
+ response:
467
+ status:
468
+ code: 200
469
+ message: OK
470
+ headers:
471
+ Server:
472
+ - Tengine
473
+ Date:
474
+ - Fri, 10 Apr 2015 09:10:38 GMT
475
+ Content-Type:
476
+ - application/json;charset=utf-8
477
+ Content-Length:
478
+ - '131'
479
+ Connection:
480
+ - keep-alive
481
+ Last-Modified:
482
+ - Fri, 10 Apr 2015 09:10:38.643 GMT
483
+ Cache-Control:
484
+ - no-cache,no-store
485
+ Pragma:
486
+ - no-cache
487
+ Strict-Transport-Security:
488
+ - max-age=31536000
489
+ body:
490
+ encoding: UTF-8
491
+ string: '{"updatedAt":"2015-04-10T09:10:38.643Z","name":"john","createdAt":"2015-04-10T09:10:38.361Z","objectId":"5527938ee4b0da2c5defa157"}'
492
+ http_version:
493
+ recorded_at: Fri, 10 Apr 2015 09:10:38 GMT
494
+ - request:
495
+ method: put
496
+ uri: https://api.leancloud.cn/1.1/classes/TestSave/5527938ee4b0da2c5defa157?new=true
497
+ body:
498
+ encoding: UTF-8
499
+ string: '{"name":"dave"}'
500
+ headers:
501
+ User-Agent:
502
+ - Parse for Ruby, 0.0
503
+ Content-Type:
504
+ - application/json
505
+ X-Avoscloud-Application-Id:
506
+ - <X-AVOSCloud-Application-Id>
507
+ X-Avoscloud-Application-Key:
508
+ - <X-AVOSCloud-Application-Key>
509
+ Accept-Encoding:
510
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
511
+ Accept:
512
+ - '*/*'
513
+ response:
514
+ status:
515
+ code: 200
516
+ message: OK
517
+ headers:
518
+ Server:
519
+ - Tengine
520
+ Date:
521
+ - Fri, 10 Apr 2015 09:10:39 GMT
522
+ Content-Type:
523
+ - application/json;charset=utf-8
524
+ Content-Length:
525
+ - '92'
526
+ Connection:
527
+ - keep-alive
528
+ Cache-Control:
529
+ - no-cache,no-store
530
+ Pragma:
531
+ - no-cache
532
+ Strict-Transport-Security:
533
+ - max-age=31536000
534
+ body:
535
+ encoding: UTF-8
536
+ string: '{"objectId":"5527938ee4b0da2c5defa157","name":"dave","updatedAt":"2015-04-10T09:10:39.138Z"}'
537
+ http_version:
538
+ recorded_at: Fri, 10 Apr 2015 09:10:39 GMT
539
+ - request:
540
+ method: get
541
+ uri: https://api.leancloud.cn/1.1/classes/TestSave/5527938ee4b0da2c5defa157
542
+ body:
543
+ encoding: US-ASCII
544
+ string: ''
545
+ headers:
546
+ User-Agent:
547
+ - Parse for Ruby, 0.0
548
+ Content-Type:
549
+ - application/json
550
+ X-Avoscloud-Application-Id:
551
+ - <X-AVOSCloud-Application-Id>
552
+ X-Avoscloud-Application-Key:
553
+ - <X-AVOSCloud-Application-Key>
554
+ Accept-Encoding:
555
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
556
+ Accept:
557
+ - '*/*'
558
+ response:
559
+ status:
560
+ code: 200
561
+ message: OK
562
+ headers:
563
+ Server:
564
+ - Tengine
565
+ Date:
566
+ - Fri, 10 Apr 2015 09:10:39 GMT
567
+ Content-Type:
568
+ - application/json;charset=utf-8
569
+ Content-Length:
570
+ - '131'
571
+ Connection:
572
+ - keep-alive
573
+ Last-Modified:
574
+ - Fri, 10 Apr 2015 09:10:39.138 GMT
575
+ Cache-Control:
576
+ - no-cache,no-store
577
+ Pragma:
578
+ - no-cache
579
+ Strict-Transport-Security:
580
+ - max-age=31536000
581
+ body:
582
+ encoding: UTF-8
583
+ string: '{"updatedAt":"2015-04-10T09:10:39.138Z","name":"dave","createdAt":"2015-04-10T09:10:38.361Z","objectId":"5527938ee4b0da2c5defa157"}'
584
+ http_version:
585
+ recorded_at: Fri, 10 Apr 2015 09:10:39 GMT
586
+ recorded_with: VCR 2.4.0