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,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/models/1114694/info/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="52e5dfb06818522eb5b393dde92c2cf6",
14
+ oauth_signature="XENRZZw%2BQYRP63%2BUA7JTOaE2cqM%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369410909", 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:55: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
+ - '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","modelId":"1114694","modelVersion":"0","title":"Usb-holder","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"}}}'
63
+ http_version:
64
+ recorded_at: Fri, 24 May 2013 15:55:09 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/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="0455d3cf11f520ba9b992eb355cd3941",
14
+ oauth_signature="FM4HDTOEYwKugvgmj8V32G1hUYo%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369408638", 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:17:19 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","models":null,"nextActionSuggestions":[]}'
62
+ http_version:
63
+ recorded_at: Fri, 24 May 2013 15:17:19 GMT
64
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.shapeways.com/price/v1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"volume":1.0e-06,"area":0.0006,"xBoundMin":0,"xBoundMax":0.01,"yBoundMin":0,"yBoundMax":0.01,"zBoundMin":0,"zBoundMax":0.01}'
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="3cf3f2d066b7baf86f302c3e647386b0",
16
+ oauth_signature="QdQgFDzn39QYLPrNzffabEDyXes%3D", oauth_signature_method="HMAC-SHA1",
17
+ oauth_timestamp="1369415096", 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 17:04:56 GMT
32
+ Content-Type:
33
+ - application/json; charset=utf-8
34
+ Transfer-Encoding:
35
+ - chunked
36
+ Connection:
37
+ - keep-alive
38
+ X-Powered-By:
39
+ - PHP/5.3.6-13ubuntu3.7
40
+ X-Ratelimit-Oktogo-Inseconds:
41
+ - '0'
42
+ X-Ratelimit-Window-Inminutes:
43
+ - '5'
44
+ X-Ratelimit-Retry-Inseconds:
45
+ - '0'
46
+ X-Ratelimit-Window-Inseconds:
47
+ - '300'
48
+ X-Ratelimit-Limit:
49
+ - '150'
50
+ X-Ratelimit-Remaining:
51
+ - '149'
52
+ Cache-Control:
53
+ - no-cache, must-revalidate
54
+ Expires:
55
+ - Mon, 26 Jul 1997 05:00:00 GMT
56
+ Vary:
57
+ - Accept-Encoding
58
+ Set-Cookie:
59
+ - whid=1; path=/
60
+ body:
61
+ encoding: UTF-8
62
+ string: '{"result":"success","prices":{"6":{"materialId":"6","price":2.9,"currency":"USD"},"62":{"materialId":"62","price":3.5,"currency":"USD"},"25":{"materialId":"25","price":3.5,"currency":"USD"},"76":{"materialId":"76","price":3.75,"currency":"USD"},"77":{"materialId":"77","price":3.75,"currency":"USD"},"78":{"materialId":"78","price":3.75,"currency":"USD"},"75":{"materialId":"75","price":3.75,"currency":"USD"},"61":{"materialId":"61","price":8.49,"currency":"USD"},"60":{"materialId":"60","price":7.39,"currency":"USD"},"5":{"materialId":"5","price":5.49,"currency":"USD"},"7":{"materialId":"7","price":5.49,"currency":"USD"},"4":{"materialId":"4","price":5.49,"currency":"USD"},"26":{"materialId":"26","price":3.75,"currency":"USD"},"27":{"materialId":"27","price":3.75,"currency":"USD"},"70":{"materialId":"70","price":1.08,"currency":"USD"},"64":{"materialId":"64","price":1.08,"currency":"USD"},"63":{"materialId":"63","price":1.08,"currency":"USD"},"74":{"materialId":"74","price":1.08,"currency":"USD"},"73":{"materialId":"73","price":1.08,"currency":"USD"},"72":{"materialId":"72","price":1.08,"currency":"USD"},"81":{"materialId":"81","price":73,"currency":"USD"},"54":{"materialId":"54","price":55,"currency":"USD"},"53":{"materialId":"53","price":50,"currency":"USD"},"23":{"materialId":"23","price":14,"currency":"USD"},"31":{"materialId":"31","price":17,"currency":"USD"},"39":{"materialId":"39","price":17,"currency":"USD"},"37":{"materialId":"37","price":15.5,"currency":"USD"},"38":{"materialId":"38","price":15.5,"currency":"USD"},"28":{"materialId":"28","price":3.25,"currency":"USD"},"66":{"materialId":"66","price":3.5,"currency":"USD"}},"nextActionSuggestions":{"uploadModel":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/v1","link":"\/models\/v1"}}}'
63
+ http_version:
64
+ recorded_at: Fri, 24 May 2013 17:04:57 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/printers/8/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="86b9ef1374f9ec1d329f38a0bbecdd1f",
14
+ oauth_signature="dVBg6kcFAQOOfsfvAu8btYtS2dQ%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369414169", 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:49:29 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","printerId":"8","title":"SLS Color Printer","xBoundMin":"0.0700","xBoundMax":"18.0000","yBoundMin":"0.0700","yBoundMax":"23.0000","zBoundMin":"0.0700","zBoundMax":"32.0000","nextActionSuggestions":[]}'
62
+ http_version:
63
+ recorded_at: Fri, 24 May 2013 16:49:29 GMT
64
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,85 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.shapeways.com/printers/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="b98ccb2c55ef7b36450014a174c46c13",
14
+ oauth_signature="fpKmcbKmYr3cIpKkwfjrHmAZkHc%3D", oauth_signature_method="HMAC-SHA1",
15
+ oauth_timestamp="1369413988", 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:46:28 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","printers":[{"printerId":"1","title":"Somatech
62
+ FDM","xBoundMin":"0.2500","xBoundMax":"25.0000","yBoundMin":"0.2500","yBoundMax":"25.0000","zBoundMin":"0.1000","zBoundMax":"30.0000"},{"printerId":"4","title":"Somatech
63
+ Objet 720","xBoundMin":"0.2390","xBoundMax":"25.0000","yBoundMin":"0.2390","yBoundMax":"25.0000","zBoundMin":"0.1000","zBoundMax":"20.0000"},{"printerId":"5","title":"SLS
64
+ Printer","xBoundMin":"0.0700","xBoundMax":"66.0000","yBoundMin":"0.0700","yBoundMax":"35.0000","zBoundMin":"0.0700","zBoundMax":"55.0000"},{"printerId":"6","title":"Metal
65
+ Printer matt","xBoundMin":"0.2500","xBoundMax":"100.0000","yBoundMin":"0.2500","yBoundMax":"45.0000","zBoundMin":"0.3000","zBoundMax":"25.0000"},{"printerId":"8","title":"SLS
66
+ Color Printer","xBoundMin":"0.0700","xBoundMax":"18.0000","yBoundMin":"0.0700","yBoundMax":"23.0000","zBoundMin":"0.0700","zBoundMax":"32.0000"},{"printerId":"9","title":"Silver
67
+ Printer","xBoundMin":"0.2390","xBoundMax":"15.0000","yBoundMin":"0.2390","yBoundMax":"15.0000","zBoundMin":"0.0600","zBoundMax":"3.0000"},{"printerId":"10","title":"White
68
+ Glaze FDM","xBoundMin":"0.2500","xBoundMax":"0.2500","yBoundMin":"0.2500","yBoundMax":"0.2500","zBoundMin":"0.2500","zBoundMax":"0.2500"},{"printerId":"11","title":"ZPrinter
69
+ 650","xBoundMin":"0.2500","xBoundMax":"25.4000","yBoundMin":"0.2500","yBoundMax":"38.1000","zBoundMin":"0.3000","zBoundMax":"20.3000"},{"printerId":"12","title":"SLS
70
+ Alumide","xBoundMin":"0.0800","xBoundMax":"18.4110","yBoundMin":"0.0800","yBoundMax":"23.2560","zBoundMin":"0.0800","zBoundMax":"31.7000"},{"printerId":"13","title":"Glass
71
+ Printer","xBoundMin":"0.2499","xBoundMax":"7.5000","yBoundMin":"0.2499","yBoundMax":"7.5000","zBoundMin":"0.3000","zBoundMax":"7.5000"},{"printerId":"14","title":"Metal
72
+ printer Gold","xBoundMin":"0.2490","xBoundMax":"100.0000","yBoundMin":"0.2490","yBoundMax":"45.0000","zBoundMin":"0.3000","zBoundMax":"25.0000"},{"printerId":"15","title":"SLS
73
+ Color Printer New","xBoundMin":"0.0700","xBoundMax":"18.0000","yBoundMin":"0.0700","yBoundMax":"23.0000","zBoundMin":"0.0700","zBoundMax":"32.0000"},{"printerId":"16","title":"Shapeways
74
+ products","xBoundMin":"0.2500","xBoundMax":"35.0000","yBoundMin":"0.2500","yBoundMax":"35.0000","zBoundMin":"0.2500","zBoundMax":"35.0000"},{"printerId":"18","title":"HD
75
+ printer","xBoundMin":"0.2490","xBoundMax":"29.8000","yBoundMin":"0.2490","yBoundMax":"18.5000","zBoundMin":"0.0500","zBoundMax":"20.3000"},{"printerId":"19","title":"UHD
76
+ printer","xBoundMin":"0.2490","xBoundMax":"12.7000","yBoundMin":"0.2490","yBoundMax":"17.8000","zBoundMin":"0.0300","zBoundMax":"15.8000"},{"printerId":"20","title":"SLS
77
+ Printer polished","xBoundMin":"0.2490","xBoundMax":"15.0000","yBoundMin":"0.2490","yBoundMax":"15.0000","zBoundMin":"0.1000","zBoundMax":"15.0000"},{"printerId":"21","title":"Ceramics
78
+ printer","xBoundMin":"0.2490","xBoundMax":"34.0000","yBoundMin":"0.2490","yBoundMax":"24.0000","zBoundMin":"0.2490","zBoundMax":"17.0000"},{"printerId":"22","title":"SLS
79
+ Polished Alumide","xBoundMin":"0.1000","xBoundMax":"15.0000","yBoundMin":"0.1000","yBoundMax":"15.0000","zBoundMin":"0.1000","zBoundMax":"15.0000"},{"printerId":"23","title":"Sinterstation
80
+ Flex","xBoundMin":"0.7000","xBoundMax":"26.0000","yBoundMin":"0.7000","yBoundMax":"21.0000","zBoundMin":"0.1500","zBoundMax":"17.0000"},{"printerId":"24","title":"High
81
+ Definition Stainless Steel","xBoundMin":"0.3000","xBoundMax":"4.0000","yBoundMin":"0.3000","yBoundMax":"4.0000","zBoundMin":"0.3000","zBoundMax":"3.5000"},{"printerId":"25","title":"Super
82
+ Silver Printer","xBoundMin":"0.2400","xBoundMax":"10.0000","yBoundMin":"0.2400","yBoundMax":"10.0000","zBoundMin":"0.0600","zBoundMax":"3.0000"}],"nextActionSuggestions":[]}'
83
+ http_version:
84
+ recorded_at: Fri, 24 May 2013 16:46:28 GMT
85
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://api.shapeways.com/models/1114694/info/v1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"description":"USB thingy"}'
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="9b4817b818298b7c549cde079a80b26e",
16
+ oauth_signature="InNGFt8Dq1CwhnU3n9MECfP%2Bug8%3D", oauth_signature_method="HMAC-SHA1",
17
+ oauth_timestamp="1369412867", 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 16:27:47 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
+ - '148'
48
+ Cache-Control:
49
+ - no-cache, must-revalidate
50
+ - private
51
+ Expires:
52
+ - Mon, 26 Jul 1997 05:00:00 GMT
53
+ Vary:
54
+ - Accept-Encoding
55
+ Set-Cookie:
56
+ - whid=2; path=/
57
+ Transfer-Encoding:
58
+ - chunked
59
+ Proxy-Connection:
60
+ - Keep-alive
61
+ body:
62
+ encoding: UTF-8
63
+ string: '{"result":"success","modelId":"1114694","modelVersion":"0","title":"Usb-holder","description":"USB
64
+ thingy","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":{"getModel":{"method":"GET","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/v1","link":"\/models\/1114694\/v1"},"downloadModel":{"method":"GET","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/0\/v1?file=1","link":"\/models\/1114694\/files\/0\/v1?file=1"},"updateModelFile":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/files\/v1","link":"\/models\/1114694\/files\/v1"},"addModelPhoto":{"method":"POST","restUrl":"http:\/\/api.shapeways.com\/models\/1114694\/photos\/v1","link":"\/models\/1114694\/photos\/v1"}}}'
65
+ http_version:
66
+ recorded_at: Fri, 24 May 2013 16:27:47 GMT
67
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Categories do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list printers in json" do
13
+ VCR.use_cassette('categories') do
14
+ response = client.categories
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ end
18
+ end
19
+
20
+ it "should return specific printer info in json" do
21
+ VCR.use_cassette('category') do
22
+ response = client.category(100)
23
+ response.should be_an_instance_of(Hashie::Mash)
24
+ response.result.should == 'success'
25
+ response.title.should == 'Cases'
26
+ end
27
+ end
28
+
29
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Materials do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list materials in json" do
13
+ VCR.use_cassette('materials') do
14
+ response = client.materials
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ end
18
+ end
19
+
20
+ it "should add an order to the cart in json" do
21
+ VCR.use_cassette('material') do
22
+ response = client.material(77)
23
+ response.should be_an_instance_of(Hashie::Mash)
24
+ response.result.should == 'success'
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,73 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Models do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list models in json" do
13
+ VCR.use_cassette('models') do
14
+ response = client.models
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ end
18
+ end
19
+
20
+ it "should return model details in json" do
21
+ VCR.use_cassette('model') do
22
+ response = client.model(1114694)
23
+ response.should be_an_instance_of(Hashie::Mash)
24
+ response.result.should == 'success'
25
+ response.modelId.should == '1114694'
26
+ end
27
+ end
28
+
29
+ it "should add a new model" do
30
+ pending 'Need to add STL file to fixtures'
31
+ end
32
+
33
+ it "should delete the model details in json" do
34
+ pending 'Need to record deletion of a specific model id'
35
+ end
36
+
37
+ it "should return info about a specific model in json" do
38
+ VCR.use_cassette('model_info') do
39
+ response = client.model_info(1114694)
40
+ response.should be_an_instance_of(Hashie::Mash)
41
+ response.result.should == 'success'
42
+ response.modelId.should == '1114694'
43
+ end
44
+ end
45
+
46
+ it "should update model info" do
47
+ VCR.use_cassette('update_model_info') do
48
+ response = client.update_model_info(1114694, {description: 'USB thingy'})
49
+ response.should be_an_instance_of(Hashie::Mash)
50
+ response.result.should == 'success'
51
+ response.description.should == 'USB thingy'
52
+ end
53
+ end
54
+
55
+ it "should add a file to the model" do
56
+ pending 'Need to add STL file to fixtures'
57
+ end
58
+
59
+ it "should return a model file by a specific version number" do
60
+ VCR.use_cassette('model_file_by_version') do
61
+ response = client.model_file_by_version(1114694, '1')
62
+ response.should be_an_instance_of(Hashie::Mash)
63
+ response.result.should == 'success'
64
+ response.modelVersion.should == '1'
65
+ end
66
+ end
67
+
68
+ it "should add a photo to the model" do
69
+ pending "Need to add JPG file to fixutres"
70
+ end
71
+
72
+
73
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Orders do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list cart orders in json" do
13
+ VCR.use_cassette('cart') do
14
+ response = client.cart
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ end
18
+ end
19
+
20
+ it "should add an order to the cart in json" do
21
+ VCR.use_cassette('add_to_cart') do
22
+ response = client.add_to_cart(212594, 77, 1)
23
+ response.should be_an_instance_of(Hashie::Mash)
24
+ response.result.should == 'success'
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Price do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list cart orders in json" do
13
+ VCR.use_cassette('price') do
14
+ response = client.price(0.000001, 0.0006, 0, 0.01, 0, 0.01, 0, 0.01)
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reshape::Client::Printers do
4
+ let(:client) do
5
+ shapeways_client
6
+ end
7
+
8
+ after(:each) do
9
+ shapeways_client.reset
10
+ end
11
+
12
+ it "should list printers in json" do
13
+ VCR.use_cassette('printers') do
14
+ response = client.printers
15
+ response.should be_an_instance_of(Hashie::Mash)
16
+ response.result.should == 'success'
17
+ response.printers.should be_a_kind_of(Array)
18
+ end
19
+ end
20
+
21
+ it "should return specific printer info in json" do
22
+ VCR.use_cassette('printer') do
23
+ response = client.printer(8)
24
+ response.should be_an_instance_of(Hashie::Mash)
25
+ response.result.should == 'success'
26
+ response.title.should == 'SLS Color Printer'
27
+ end
28
+ end
29
+
30
+ end