reshape 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.travis.yml +5 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +77 -0
  7. data/Rakefile +8 -0
  8. data/examples/Gemfile +6 -0
  9. data/examples/config.ru +45 -0
  10. data/lib/faraday/response/raise_reshape_api_error.rb +41 -0
  11. data/lib/reshape/client/categories.rb +15 -0
  12. data/lib/reshape/client/materials.rb +15 -0
  13. data/lib/reshape/client/models.rb +43 -0
  14. data/lib/reshape/client/orders.rb +21 -0
  15. data/lib/reshape/client/price.rb +22 -0
  16. data/lib/reshape/client/printers.rb +15 -0
  17. data/lib/reshape/client.rb +34 -0
  18. data/lib/reshape/configuration.rb +63 -0
  19. data/lib/reshape/connection.rb +38 -0
  20. data/lib/reshape/error.rb +31 -0
  21. data/lib/reshape/request.rb +42 -0
  22. data/lib/reshape/version.rb +3 -0
  23. data/lib/reshape.rb +20 -0
  24. data/reshape.gemspec +33 -0
  25. data/spec/faraday/response_spec.rb +40 -0
  26. data/spec/fixtures/cassettes/add_to_cart.yml +65 -0
  27. data/spec/fixtures/cassettes/cart.yml +64 -0
  28. data/spec/fixtures/cassettes/categories.yml +71 -0
  29. data/spec/fixtures/cassettes/category.yml +64 -0
  30. data/spec/fixtures/cassettes/material.yml +65 -0
  31. data/spec/fixtures/cassettes/materials.yml +91 -0
  32. data/spec/fixtures/cassettes/model.yml +65 -0
  33. data/spec/fixtures/cassettes/model_file_by_version.yml +64 -0
  34. data/spec/fixtures/cassettes/model_info.yml +65 -0
  35. data/spec/fixtures/cassettes/models.yml +64 -0
  36. data/spec/fixtures/cassettes/price.yml +65 -0
  37. data/spec/fixtures/cassettes/printer.yml +64 -0
  38. data/spec/fixtures/cassettes/printers.yml +85 -0
  39. data/spec/fixtures/cassettes/update_model_info.yml +67 -0
  40. data/spec/reshape/client/categories_spec.rb +29 -0
  41. data/spec/reshape/client/materials_spec.rb +28 -0
  42. data/spec/reshape/client/models_spec.rb +73 -0
  43. data/spec/reshape/client/orders_spec.rb +28 -0
  44. data/spec/reshape/client/price_spec.rb +20 -0
  45. data/spec/reshape/client/printers_spec.rb +30 -0
  46. data/spec/reshape/client_spec.rb +49 -0
  47. data/spec/reshape_spec.rb +21 -0
  48. data/spec/spec_helper.rb +72 -0
  49. metadata +268 -0
@@ -0,0 +1,40 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe Faraday::Response do
5
+ before do
6
+ @client = Reshape::Client.new({
7
+ consumer_token: ENV['SHAPEWAYS_CONSUMER_TOKEN'],
8
+ consumer_secret: ENV['SHAPEWAYS_CONSUMER_SECRET'],
9
+ oauth_token: ENV['SHAPEWAYS_OAUTH_TOKEN'],
10
+ oauth_secret: ENV['SHAPEWAYS_OAUTH_SECRET'],
11
+ proxy: 'http://localhost:8888'
12
+ })
13
+ end
14
+
15
+ {
16
+ 400 => Reshape::BadRequest,
17
+ 401 => Reshape::Unauthorized,
18
+ 403 => Reshape::Forbidden,
19
+ 404 => Reshape::NotFound,
20
+ 406 => Reshape::NotAcceptable,
21
+ 422 => Reshape::UnprocessableEntity,
22
+ 500 => Reshape::InternalServerError,
23
+ # 501 => Reshape::NotImplemented,
24
+ 502 => Reshape::BadGateway,
25
+ 503 => Reshape::ServiceUnavailable,
26
+ }.each do |status, exception|
27
+ context "when HTTP status is #{status}" do
28
+
29
+ before do
30
+ stub_get('orders/cart').to_return(:status => status)
31
+ end
32
+
33
+ it "should raise #{exception.name} error" do
34
+ lambda do
35
+ @client.cart
36
+ end.should raise_error(exception)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.shapeways.com/orders/cart/v1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"modelId":212594,"materialId":77,"quantity":1}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="4d27b3f07e1168dc257fd29f1ff629f1",
16
+ oauth_signature="O83r4pHaP%2B%2FvGWp3Wb0jLqqDdOs%3D", oauth_signature_method="HMAC-SHA1",
17
+ oauth_timestamp="1369408148", oauth_token="dummy-token",
18
+ oauth_version="1.0"
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - '*/*'
23
+ response:
24
+ status:
25
+ code: 200
26
+ message: OK
27
+ headers:
28
+ Server:
29
+ - nginx/1.0.5
30
+ Date:
31
+ - Fri, 24 May 2013 15:09:08 GMT
32
+ Content-Type:
33
+ - application/json; charset=utf-8
34
+ X-Powered-By:
35
+ - PHP/5.3.6-13ubuntu3.7
36
+ X-Ratelimit-Oktogo-Inseconds:
37
+ - '0'
38
+ X-Ratelimit-Window-Inminutes:
39
+ - '5'
40
+ X-Ratelimit-Retry-Inseconds:
41
+ - '0'
42
+ X-Ratelimit-Window-Inseconds:
43
+ - '300'
44
+ X-Ratelimit-Limit:
45
+ - '150'
46
+ X-Ratelimit-Remaining:
47
+ - '149'
48
+ Cache-Control:
49
+ - no-cache, must-revalidate
50
+ Expires:
51
+ - Mon, 26 Jul 1997 05:00:00 GMT
52
+ Vary:
53
+ - Accept-Encoding
54
+ Set-Cookie:
55
+ - whid=2; path=/
56
+ Transfer-Encoding:
57
+ - chunked
58
+ Proxy-Connection:
59
+ - Keep-alive
60
+ body:
61
+ encoding: UTF-8
62
+ string: '{"result":"success","nextActionSuggestions":{"getCartList":{"method":"GET","restUrl":"http:\/\/api.shapeways.com\/orders\/cart\/v1","link":"\/orders\/cart\/v1"}}}'
63
+ http_version:
64
+ recorded_at: Fri, 24 May 2013 15:09:08 GMT
65
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/orders/cart/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="635bf901c644e2e5515b41e35e340702",
14
+ oauth_signature="9BNNE5VNE35zNuU7rOZzndKn%2FFI%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369408147", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 15:09:08 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '149'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=1; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","itemCount":8,"items":[{"cartKey":"212594-77","modelId":"212594","materialId":"77","quantity":"8"}],"nextActionSuggestions":[]}'
62
+ http_version:
63
+ recorded_at: Fri, 24 May 2013 15:09:08 GMT
64
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/categories/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="96b0482e389d8c25b3bbc2ca3d331074",
14
+ oauth_signature="tvAHCson%2BWD1PDuwISXpEqX1lf8%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369415623", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 17:13:43 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '148'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=3; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","categories":{"16":{"categoryId":"16","title":"Art","level":"1","parentId":null},"17":{"categoryId":"17","title":"Figurines","level":"2","parentId":"38"},"18":{"categoryId":"18","title":"Accessories","level":"2","parentId":"55"},"21":{"categoryId":"21","title":"Mechanical
62
+ parts","level":"2","parentId":"104"},"23":{"categoryId":"23","title":"Jewelry","level":"1","parentId":null},"25":{"categoryId":"25","title":"Accessories","level":"2","parentId":"40"},"27":{"categoryId":"27","title":"Sculptures","level":"2","parentId":"16"},"28":{"categoryId":"28","title":"Model
63
+ trains","level":"2","parentId":"38"},"29":{"categoryId":"29","title":"Puzzles","level":"2","parentId":"49"},"30":{"categoryId":"30","title":"Robotics","level":"2","parentId":"40"},"33":{"categoryId":"33","title":"SciFi","level":"2","parentId":"38"},"34":{"categoryId":"34","title":"Mathematical
64
+ Art","level":"2","parentId":"16"},"38":{"categoryId":"38","title":"Miniatures","level":"1","parentId":null},"39":{"categoryId":"39","title":"Keychains","level":"2","parentId":"40"},"40":{"categoryId":"40","title":"Gadgets","level":"1","parentId":null},"41":{"categoryId":"41","title":"Bracelets","level":"2","parentId":"23"},"42":{"categoryId":"42","title":"Cufflinks","level":"2","parentId":"23"},"43":{"categoryId":"43","title":"Earrings","level":"2","parentId":"23"},"44":{"categoryId":"44","title":"Necklaces","level":"2","parentId":"23"},"45":{"categoryId":"45","title":"Pendants","level":"2","parentId":"23"},"46":{"categoryId":"46","title":"Rings","level":"2","parentId":"23"},"48":{"categoryId":"48","title":"Memorabilia","level":"2","parentId":"38"},"49":{"categoryId":"49","title":"Games","level":"1","parentId":null},"50":{"categoryId":"50","title":"Board
65
+ games","level":"2","parentId":"49"},"51":{"categoryId":"51","title":"Dice","level":"2","parentId":"49"},"55":{"categoryId":"55","title":"For
66
+ Your Home","level":"1","parentId":null},"75":{"categoryId":"75","title":"Lighting","level":"2","parentId":"55"},"77":{"categoryId":"77","title":"Dining","level":"2","parentId":"55"},"80":{"categoryId":"80","title":"Music","level":"2","parentId":"40"},"99":{"categoryId":"99","title":"Download","level":"1","parentId":null},"100":{"categoryId":"100","title":"Cases","level":"2","parentId":"40"},"101":{"categoryId":"101","title":"Desk
67
+ Toys","level":"2","parentId":"40"},"102":{"categoryId":"102","title":"Fashion","level":"1","parentId":null},"103":{"categoryId":"103","title":"Vehicles","level":"2","parentId":"38"},"104":{"categoryId":"104","title":"Maker\/DIY","level":"1","parentId":null},"105":{"categoryId":"105","title":"Toys","level":"2","parentId":"49"},"106":{"categoryId":"106","title":"Glasses","level":"2","parentId":"102"},"107":{"categoryId":"107","title":"Belts","level":"2","parentId":"102"},"108":{"categoryId":"108","title":"Bags
68
+ & Purses","level":"2","parentId":"102"},"109":{"categoryId":"109","title":"Wallets","level":"2","parentId":"102"},"110":{"categoryId":"110","title":"Furniture","level":"2","parentId":"55"},"127":{"categoryId":"127","title":"Memes","level":"2","parentId":"16"}},"nextActionSuggestions":[]}'
69
+ http_version:
70
+ recorded_at: Fri, 24 May 2013 17:13:43 GMT
71
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/categories/100/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="3a52e08b16669066242cca09a71af345",
14
+ oauth_signature="i2TAp%2FzZSOnkRuwfoT9t8gbXDGI%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369415680", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 17:14:40 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '148'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=2; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","categoryId":"100","title":"Cases","level":"2","parentId":"40","nextActionSuggestions":[]}'
62
+ http_version:
63
+ recorded_at: Fri, 24 May 2013 17:14:40 GMT
64
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/materials/77/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="51b8d5eecc9296b3c7bf7c12eceb1896",
14
+ oauth_signature="uDoK74vWPXgpz7eQ8TITSWppOJU%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369407662", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 15:01:02 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '149'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=3; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","materialId":"77","title":"Hot Pink Strong & Flexible
62
+ Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-hot-pink.jpg","nextActionSuggestions":[]}'
63
+ http_version:
64
+ recorded_at: Fri, 24 May 2013 15:01:03 GMT
65
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,91 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/materials/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="4841e2d9e377557b01bd9a4b0a4f8115",
14
+ oauth_signature="zVQiDxrp0k77MNWY37U69cgWlVc%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369407662", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 15:01:02 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '148'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=2; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","materials":{"6":{"materialId":"6","title":"White
62
+ Strong & Flexible","supportsColorFiles":"0","printerId":"5","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_wsf_white.jpg"},"62":{"materialId":"62","title":"White
63
+ Strong & Flexible Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/wsfp_thumb.jpg"},"25":{"materialId":"25","title":"Black
64
+ Strong & Flexible","supportsColorFiles":"0","printerId":"8","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_wsf_black.jpg"},"76":{"materialId":"76","title":"Coral
65
+ Red Strong & Flexible Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-coral-red.jpg"},"77":{"materialId":"77","title":"Hot
66
+ Pink Strong & Flexible Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-hot-pink.jpg"},"78":{"materialId":"78","title":"Royal
67
+ Blue Strong & Flexible Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-royal-blue.jpg"},"75":{"materialId":"75","title":"Violet
68
+ Purple Strong & Flexible Polished","supportsColorFiles":"0","printerId":"20","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-violet-purple.jpg"},"61":{"materialId":"61","title":"Frosted
69
+ Ultra Detail","supportsColorFiles":"0","printerId":"19","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/fud_thumb.jpg"},"60":{"materialId":"60","title":"Frosted
70
+ Detail","supportsColorFiles":"0","printerId":"18","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/fd_thumb.jpg"},"5":{"materialId":"5","title":"White
71
+ Detail","supportsColorFiles":"0","printerId":"4","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_detail_white.jpg"},"7":{"materialId":"7","title":"Black
72
+ Detail","supportsColorFiles":"0","printerId":"4","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_detail_black.jpg"},"4":{"materialId":"4","title":"Transparent
73
+ Detail","supportsColorFiles":"0","printerId":"4","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_detail_transparent.jpg"},"26":{"materialId":"26","title":"Full
74
+ Color Sandstone","supportsColorFiles":"1","printerId":"11","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/sandstone_full_color.jpg"},"27":{"materialId":"27","title":"Sandstone","supportsColorFiles":"0","printerId":"11","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/sandstone_no_color.jpg"},"70":{"materialId":"70","title":"Satin
75
+ Black Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/th_sbc.jpg"},"64":{"materialId":"64","title":"Gloss
76
+ Black Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/blackceramics_thumbnail.jpg"},"63":{"materialId":"63","title":"Glazed
77
+ Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/ceramics-thumb.jpg"},"74":{"materialId":"74","title":"Pastel
78
+ Yellow Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/th_pyc.jpg"},"73":{"materialId":"73","title":"Avocado
79
+ Green Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/th_agc.jpg"},"72":{"materialId":"72","title":"Eggshell
80
+ Blue Ceramics","supportsColorFiles":"0","printerId":"21","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/th_ebc.jpg"},"81":{"materialId":"81","title":"Premium
81
+ Silver","supportsColorFiles":"0","printerId":"25","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/swatch-premium-silver-2013030403.png"},"54":{"materialId":"54","title":"Silver
82
+ Glossy","supportsColorFiles":"0","printerId":"9","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/silver_glossy.jpg"},"53":{"materialId":"53","title":"Silver","supportsColorFiles":"0","printerId":"9","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/silver.jpg"},"23":{"materialId":"23","title":"Stainless
83
+ Steel","supportsColorFiles":"0","printerId":"6","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/metal_stainless_steel.jpg"},"31":{"materialId":"31","title":"Gold
84
+ Plated Matte","supportsColorFiles":"0","printerId":"14","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/metal_gold_matt.jpg"},"39":{"materialId":"39","title":"Gold
85
+ Plated Glossy","supportsColorFiles":"0","printerId":"6","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/metal_gold_shiny.jpg"},"37":{"materialId":"37","title":"Antique
86
+ Bronze Matte","supportsColorFiles":"0","printerId":"6","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/metal_bronze_matte.jpg"},"38":{"materialId":"38","title":"Antique
87
+ Bronze Glossy","supportsColorFiles":"0","printerId":"6","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/metal_bronze_shiny.jpg"},"28":{"materialId":"28","title":"Alumide","supportsColorFiles":"0","printerId":"12","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/plastic_alumide.jpg"},"66":{"materialId":"66","title":"Polished
88
+ Alumide","supportsColorFiles":"0","printerId":"22","swatch":"http:\/\/static2.shapeways.netdna-cdn.com\/rrstatic\/img\/materials\/polished_plastic_alumide.jpg"}},"nextActionSuggestions":[]}'
89
+ http_version:
90
+ recorded_at: Fri, 24 May 2013 15:01:02 GMT
91
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/models/1114694/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="eda6da758d2b83869893f67590d6326c",
14
+ oauth_signature="pFIeu4wh2%2BRRrEUhSIcpsEnJK3Y%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369410644", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 15:50:44 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '149'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=2; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","modelId":"1114694","modelVersion":"0","title":"Usb-holder","fileName":"usb-holder.stl","contentLength":4684,"fileMd5Checksum":"2bca8c0924d2972e4708532804864ef8","fileData":null,"description":"A
62
+ USB memory stick holder.","isPublic":0,"isForSale":0,"materials":{"6":{"materialId":"6","markup":"0.000000","isActive":1},"62":{"materialId":"62","markup":"0.000000","isActive":1},"25":{"materialId":"25","markup":"0.000000","isActive":1},"76":{"materialId":"76","markup":"0.000000","isActive":1},"77":{"materialId":"77","markup":"0.000000","isActive":1},"78":{"materialId":"78","markup":"0.000000","isActive":1},"75":{"materialId":"75","markup":"0.000000","isActive":1},"61":{"materialId":"61","markup":"0.000000","isActive":1},"60":{"materialId":"60","markup":"0.000000","isActive":1},"5":{"materialId":"5","markup":"0.000000","isActive":1},"7":{"materialId":"7","markup":"0.000000","isActive":1},"4":{"materialId":"4","markup":"0.000000","isActive":1},"27":{"materialId":"27","markup":"0.000000","isActive":1},"81":{"materialId":"81","markup":"0.000000","isActive":1},"54":{"materialId":"54","markup":"0.000000","isActive":1},"53":{"materialId":"53","markup":"0.000000","isActive":1},"23":{"materialId":"23","markup":"0.000000","isActive":1},"31":{"materialId":"31","markup":"0.000000","isActive":1},"39":{"materialId":"39","markup":"0.000000","isActive":1},"37":{"materialId":"37","markup":"0.000000","isActive":1},"38":{"materialId":"38","markup":"0.000000","isActive":1},"66":{"materialId":"66","markup":"0.000000","isActive":1},"28":{"materialId":"28","markup":"0.000000","isActive":1},"26":{"materialId":"26","markup":"0.000000","isActive":1},"72":{"materialId":"72","markup":"0.000000","isActive":1},"64":{"materialId":"64","markup":"0.000000","isActive":1},"63":{"materialId":"63","markup":"0.000000","isActive":1},"74":{"materialId":"74","markup":"0.000000","isActive":1},"73":{"materialId":"73","markup":"0.000000","isActive":1},"70":{"materialId":"70","markup":"0.000000","isActive":1}},"secretKey":"15c4e2b177ec8112c9ae613efbccc70b","defaultMaterialId":"6","categories":{"25":{"categoryId":"25","title":"Accessories","level":"2","parentId":"40"}},"nextActionSuggestions":{"addModelToShoppingCart":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/orders\/cart\/v1","link":"\/orders\/cart\/v1","parameters":{"modelId":"1114694","materialId":"int","count":"int"}},"downloadModel":{"method":"GET","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/0\/v1?file=1","link":"\/models\/1114694\/files\/0\/v1?file=1"},"updateModelDetails":{"method":"PUT","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/info\/v1","link":"\/models\/1114694\/info\/v1"},"updateModelFile":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/v1","link":"\/models\/1114694\/files\/v1"},"deleteModel":{"method":"DELETE","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/v1","link":"\/models\/1114694\/v1"},"addModelPhoto":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/photos\/v1","link":"\/models\/1114694\/photos\/v1"}},"printable":"yes"}'
63
+ http_version:
64
+ recorded_at: Fri, 24 May 2013 15:50:44 GMT
65
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/models/1114694/files/1/v1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.7
12
+ Authorization:
13
+ - OAuth oauth_consumer_key="dummy-key", oauth_nonce="13e2ad5f709c5e475613685898f819bf",
14
+ oauth_signature="klC6C37mk11Fnwy7WNwisgQ%2B1WE%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369413368", oauth_token="dummy-token",
16
+ oauth_version="1.0"
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - '*/*'
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Server:
27
+ - nginx/1.0.5
28
+ Date:
29
+ - Fri, 24 May 2013 16:36:09 GMT
30
+ Content-Type:
31
+ - application/json; charset=utf-8
32
+ X-Powered-By:
33
+ - PHP/5.3.6-13ubuntu3.7
34
+ X-Ratelimit-Oktogo-Inseconds:
35
+ - '0'
36
+ X-Ratelimit-Window-Inminutes:
37
+ - '5'
38
+ X-Ratelimit-Retry-Inseconds:
39
+ - '0'
40
+ X-Ratelimit-Window-Inseconds:
41
+ - '300'
42
+ X-Ratelimit-Limit:
43
+ - '150'
44
+ X-Ratelimit-Remaining:
45
+ - '149'
46
+ Cache-Control:
47
+ - no-cache, must-revalidate
48
+ - private
49
+ Expires:
50
+ - Mon, 26 Jul 1997 05:00:00 GMT
51
+ Vary:
52
+ - Accept-Encoding
53
+ Set-Cookie:
54
+ - whid=3; path=/
55
+ Transfer-Encoding:
56
+ - chunked
57
+ Proxy-Connection:
58
+ - Keep-alive
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"result":"success","modelId":"1114694","modelVersion":"1","title":"Usb-holder","fileName":"usb-holder.stl","contentLength":4684,"fileMd5Checksum":"2bca8c0924d2972e4708532804864ef8","fileData":null,"nextActionSuggestions":{"updateModelFile":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/v1","link":"\/models\/1114694\/files\/v1"},"downloadModel":{"method":"GET","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/1\/v1?file=1","link":"\/models\/1114694\/files\/1\/v1?file=1"},"updateModelDetails":{"method":"PUT","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/info\/v1","link":"\/models\/1114694\/info\/v1"},"deleteModel":{"method":"DELETE","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/v1","link":"\/models\/1114694\/v1"}},"printable":"yes"}'
62
+ http_version:
63
+ recorded_at: Fri, 24 May 2013 16:36:09 GMT
64
+ recorded_with: VCR 2.5.0