patch_ruby 1.0.0.pre → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +69 -0
  3. data/Gemfile +1 -2
  4. data/Gemfile.lock +13 -12
  5. data/Makefile +10 -0
  6. data/README.md +144 -15
  7. data/lib/patch_ruby.rb +2 -0
  8. data/lib/patch_ruby/models/allocation.rb +15 -0
  9. data/lib/patch_ruby/models/create_mass_estimate_request.rb +41 -4
  10. data/lib/patch_ruby/models/create_order_request.rb +68 -7
  11. data/lib/patch_ruby/models/estimate.rb +15 -0
  12. data/lib/patch_ruby/models/order.rb +85 -4
  13. data/lib/patch_ruby/models/photo.rb +216 -0
  14. data/lib/patch_ruby/models/preference.rb +15 -0
  15. data/lib/patch_ruby/models/project.rb +119 -25
  16. data/lib/patch_ruby/models/standard.rb +244 -0
  17. data/lib/patch_ruby/version.rb +1 -1
  18. data/spec/api/estimates_api_spec.rb +6 -7
  19. data/spec/api/orders_api_spec.rb +10 -11
  20. data/spec/api/preferences_api_spec.rb +8 -9
  21. data/spec/api/projects_api_spec.rb +4 -5
  22. data/spec/api_client_spec.rb +12 -33
  23. data/spec/constants.rb +3 -0
  24. data/spec/integration/estimates_spec.rb +30 -23
  25. data/spec/integration/orders_spec.rb +85 -38
  26. data/spec/integration/preferences_spec.rb +24 -30
  27. data/spec/integration/projects_spec.rb +38 -27
  28. data/spec/models/allocation_spec.rb +0 -1
  29. data/spec/models/create_mass_estimate_request_spec.rb +0 -1
  30. data/spec/models/create_order_request_spec.rb +0 -1
  31. data/spec/models/create_preference_request_spec.rb +0 -1
  32. data/spec/models/error_response_spec.rb +0 -1
  33. data/spec/models/estimate_list_response_spec.rb +0 -1
  34. data/spec/models/estimate_response_spec.rb +0 -1
  35. data/spec/models/estimate_spec.rb +0 -1
  36. data/spec/models/meta_index_object_spec.rb +0 -1
  37. data/spec/models/order_list_response_spec.rb +0 -1
  38. data/spec/models/order_response_spec.rb +0 -1
  39. data/spec/models/order_spec.rb +0 -1
  40. data/spec/models/preference_list_response_spec.rb +0 -1
  41. data/spec/models/preference_response_spec.rb +0 -1
  42. data/spec/models/preference_spec.rb +0 -1
  43. data/spec/models/project_list_response_spec.rb +0 -1
  44. data/spec/models/project_response_spec.rb +0 -1
  45. data/spec/models/project_spec.rb +0 -1
  46. data/spec/spec_helper.rb +1 -11
  47. metadata +26 -30
  48. data/spec/fixtures/vcr_cassettes/estimate_orders.yml +0 -276
  49. data/spec/fixtures/vcr_cassettes/estimates.yml +0 -211
  50. data/spec/fixtures/vcr_cassettes/orders.yml +0 -229
  51. data/spec/fixtures/vcr_cassettes/preferences.yml +0 -352
  52. data/spec/fixtures/vcr_cassettes/projects.yml +0 -143
@@ -1,31 +1,42 @@
1
- require 'spec_helper'
2
-
3
1
  RSpec.describe 'Projects Integration' do
4
- it "supports retrieve and list" do
5
- VCR.use_cassette('projects') do
6
- # Configure the Patch gem
7
- Patch.configure do |config|
8
- config.access_token = ENV['PATCH_RUBY_API_KEY']
9
- config.host = ENV['PATCH_RUBY_HOST']
10
- end
11
-
12
- # START receive_projects
13
- page_limit = 1
14
- next_page = 1
15
- projects = []
16
-
17
- while !next_page.nil? && next_page <= page_limit
18
- retrieve_projects_response = Patch::Project.retrieve_projects(page: next_page)
19
- next_page = retrieve_projects_response.meta.next_page
20
- projects += retrieve_projects_response.data
21
- end
22
-
23
- expect(projects.length).not_to be_zero
24
- project_id = retrieve_projects_response.data.first.id
25
- # END receive_projects
26
-
27
- retrieve_project_response = Patch::Project.retrieve_project(project_id)
28
- expect(retrieve_project_response.data.id).to eq project_id
2
+ Patch.configure do |config|
3
+ config.access_token = ENV['SANDBOX_API_KEY']
4
+ end
5
+
6
+ it 'supports retrieve and list' do
7
+ page_limit = 1
8
+ next_page = 1
9
+ projects = []
10
+
11
+ while !next_page.nil? && next_page <= page_limit
12
+ retrieve_projects_response = Patch::Project.retrieve_projects(page: next_page)
13
+ next_page = retrieve_projects_response.meta.next_page
14
+ projects += retrieve_projects_response.data
15
+ end
16
+
17
+ expect(projects.length).not_to be_zero
18
+ project_id = retrieve_projects_response.data.first.id
19
+ # END receive_projects
20
+
21
+ retrieve_project_response = Patch::Project.retrieve_project(project_id)
22
+ expect(retrieve_project_response.data.id).to eq project_id
23
+ end
24
+
25
+ describe 'returned fields' do
26
+ before do
27
+ @project = Patch::Project.retrieve_projects(page: 1).data.first
28
+ end
29
+
30
+ it 'returns photos' do
31
+ expect(@project.photos).to be_an_instance_of(Array)
32
+ end
33
+
34
+ it 'returns average_price_per_tonne_cents_usd' do
35
+ expect(@project.average_price_per_tonne_cents_usd).to be_an_instance_of(Integer)
36
+ end
37
+
38
+ it 'returns remaining_mass_g' do
39
+ expect(@project.remaining_mass_g).to be_an_instance_of(Integer)
29
40
  end
30
41
  end
31
42
  end
@@ -49,5 +49,4 @@ describe 'Allocation' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -37,5 +37,4 @@ describe 'CreateMassEstimateRequest' do
37
37
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
38
  end
39
39
  end
40
-
41
40
  end
@@ -37,5 +37,4 @@ describe 'CreateOrderRequest' do
37
37
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
38
  end
39
39
  end
40
-
41
40
  end
@@ -37,5 +37,4 @@ describe 'CreatePreferenceRequest' do
37
37
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
38
  end
39
39
  end
40
-
41
40
  end
@@ -49,5 +49,4 @@ describe 'ErrorResponse' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -55,5 +55,4 @@ describe 'EstimateListResponse' do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
56
  end
57
57
  end
58
-
59
58
  end
@@ -49,5 +49,4 @@ describe 'EstimateResponse' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -55,5 +55,4 @@ describe 'Estimate' do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
56
  end
57
57
  end
58
-
59
58
  end
@@ -43,5 +43,4 @@ describe 'MetaIndexObject' do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
44
  end
45
45
  end
46
-
47
46
  end
@@ -55,5 +55,4 @@ describe 'OrderListResponse' do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
56
  end
57
57
  end
58
-
59
58
  end
@@ -49,5 +49,4 @@ describe 'OrderResponse' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -81,5 +81,4 @@ describe 'Order' do
81
81
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
82
82
  end
83
83
  end
84
-
85
84
  end
@@ -55,5 +55,4 @@ describe 'PreferenceListResponse' do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
56
  end
57
57
  end
58
-
59
58
  end
@@ -49,5 +49,4 @@ describe 'PreferenceResponse' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -49,5 +49,4 @@ describe 'Preference' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -55,5 +55,4 @@ describe 'ProjectListResponse' do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
56
  end
57
57
  end
58
-
59
58
  end
@@ -49,5 +49,4 @@ describe 'ProjectResponse' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
51
51
  end
52
-
53
52
  end
@@ -85,5 +85,4 @@ describe 'Project' do
85
85
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
86
  end
87
87
  end
88
-
89
88
  end
@@ -12,7 +12,7 @@ OpenAPI Generator version: 4.3.1
12
12
 
13
13
  # load the gem
14
14
  require 'patch_ruby'
15
- require 'vcr'
15
+ require 'constants'
16
16
 
17
17
  # The following was generated by the `rspec --init` command. Conventionally, all
18
18
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
@@ -109,14 +109,4 @@ RSpec.configure do |config|
109
109
  # as the one that triggered the failure.
110
110
  Kernel.srand config.seed
111
111
  =end
112
-
113
- # VCR
114
- VCR.configure do |config|
115
- config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
116
- config.hook_into :typhoeus
117
- # Filter out API tokens from VCR cassettes so they aren't committed to source control
118
- config.filter_sensitive_data('<AUTH>') do |interaction|
119
- interaction.request.headers['Authorization'].first
120
- end
121
- end
122
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patch Technology
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -77,8 +77,10 @@ executables: []
77
77
  extensions: []
78
78
  extra_rdoc_files: []
79
79
  files:
80
+ - CHANGELOG.md
80
81
  - Gemfile
81
82
  - Gemfile.lock
83
+ - Makefile
82
84
  - README.md
83
85
  - Rakefile
84
86
  - lib/patch_ruby.rb
@@ -101,12 +103,14 @@ files:
101
103
  - lib/patch_ruby/models/order.rb
102
104
  - lib/patch_ruby/models/order_list_response.rb
103
105
  - lib/patch_ruby/models/order_response.rb
106
+ - lib/patch_ruby/models/photo.rb
104
107
  - lib/patch_ruby/models/preference.rb
105
108
  - lib/patch_ruby/models/preference_list_response.rb
106
109
  - lib/patch_ruby/models/preference_response.rb
107
110
  - lib/patch_ruby/models/project.rb
108
111
  - lib/patch_ruby/models/project_list_response.rb
109
112
  - lib/patch_ruby/models/project_response.rb
113
+ - lib/patch_ruby/models/standard.rb
110
114
  - lib/patch_ruby/version.rb
111
115
  - patch_ruby.gemspec
112
116
  - spec/api/estimates_api_spec.rb
@@ -115,11 +119,7 @@ files:
115
119
  - spec/api/projects_api_spec.rb
116
120
  - spec/api_client_spec.rb
117
121
  - spec/configuration_spec.rb
118
- - spec/fixtures/vcr_cassettes/estimate_orders.yml
119
- - spec/fixtures/vcr_cassettes/estimates.yml
120
- - spec/fixtures/vcr_cassettes/orders.yml
121
- - spec/fixtures/vcr_cassettes/preferences.yml
122
- - spec/fixtures/vcr_cassettes/projects.yml
122
+ - spec/constants.rb
123
123
  - spec/integration/estimates_spec.rb
124
124
  - spec/integration/orders_spec.rb
125
125
  - spec/integration/preferences_spec.rb
@@ -158,46 +158,42 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
158
  version: '1.9'
159
159
  required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">"
161
+ - - ">="
162
162
  - !ruby/object:Gem::Version
163
- version: 1.3.1
163
+ version: '0'
164
164
  requirements: []
165
165
  rubygems_version: 3.1.2
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Ruby wrapper for the Patch API
169
169
  test_files:
170
- - spec/api/orders_api_spec.rb
170
+ - spec/api/preferences_api_spec.rb
171
171
  - spec/api/estimates_api_spec.rb
172
+ - spec/api/orders_api_spec.rb
172
173
  - spec/api/projects_api_spec.rb
173
- - spec/api/preferences_api_spec.rb
174
174
  - spec/api_client_spec.rb
175
175
  - spec/configuration_spec.rb
176
- - spec/fixtures/vcr_cassettes/preferences.yml
177
- - spec/fixtures/vcr_cassettes/estimate_orders.yml
178
- - spec/fixtures/vcr_cassettes/orders.yml
179
- - spec/fixtures/vcr_cassettes/estimates.yml
180
- - spec/fixtures/vcr_cassettes/projects.yml
181
- - spec/integration/orders_spec.rb
176
+ - spec/constants.rb
177
+ - spec/integration/projects_spec.rb
182
178
  - spec/integration/preferences_spec.rb
183
179
  - spec/integration/estimates_spec.rb
184
- - spec/integration/projects_spec.rb
185
- - spec/models/create_mass_estimate_request_spec.rb
180
+ - spec/integration/orders_spec.rb
186
181
  - spec/models/order_response_spec.rb
187
- - spec/models/order_list_response_spec.rb
188
- - spec/models/order_spec.rb
189
- - spec/models/create_preference_request_spec.rb
182
+ - spec/models/estimate_list_response_spec.rb
183
+ - spec/models/project_spec.rb
184
+ - spec/models/estimate_response_spec.rb
185
+ - spec/models/project_response_spec.rb
190
186
  - spec/models/error_response_spec.rb
191
- - spec/models/preference_spec.rb
192
- - spec/models/preference_list_response_spec.rb
187
+ - spec/models/estimate_spec.rb
188
+ - spec/models/create_mass_estimate_request_spec.rb
193
189
  - spec/models/project_list_response_spec.rb
190
+ - spec/models/preference_spec.rb
194
191
  - spec/models/create_order_request_spec.rb
195
- - spec/models/meta_index_object_spec.rb
196
- - spec/models/estimate_list_response_spec.rb
192
+ - spec/models/order_list_response_spec.rb
193
+ - spec/models/preference_list_response_spec.rb
197
194
  - spec/models/preference_response_spec.rb
198
- - spec/models/estimate_spec.rb
199
- - spec/models/estimate_response_spec.rb
200
- - spec/models/project_response_spec.rb
201
- - spec/models/project_spec.rb
202
195
  - spec/models/allocation_spec.rb
196
+ - spec/models/order_spec.rb
197
+ - spec/models/meta_index_object_spec.rb
198
+ - spec/models/create_preference_request_spec.rb
203
199
  - spec/spec_helper.rb
@@ -1,276 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.staging-patch.com/v1/estimates/mass
6
- body:
7
- encoding: UTF-8
8
- string: '{"mass_g":100}'
9
- headers:
10
- User-Agent:
11
- - OpenAPI-Generator/1.0.0.pre/ruby
12
- Content-Type:
13
- - application/json
14
- Accept:
15
- - application/json
16
- Authorization:
17
- - "<AUTH>"
18
- Expect:
19
- - ''
20
- response:
21
- status:
22
- code: 201
23
- message: ''
24
- headers:
25
- server:
26
- - nginx/1.17.8
27
- date:
28
- - Thu, 02 Jul 2020 17:44:24 GMT
29
- content-type:
30
- - application/json; charset=utf-8
31
- x-frame-options:
32
- - SAMEORIGIN
33
- x-xss-protection:
34
- - 1; mode=block
35
- x-content-type-options:
36
- - nosniff
37
- x-download-options:
38
- - noopen
39
- x-permitted-cross-domain-policies:
40
- - none
41
- referrer-policy:
42
- - strict-origin-when-cross-origin
43
- etag:
44
- - W/"af0b00bb84b4c38293ed30105f13c5c6"
45
- cache-control:
46
- - max-age=0, private, must-revalidate
47
- x-request-id:
48
- - 28a69e9c0e7efc14c2224edd51cd3571
49
- x-runtime:
50
- - '0.048519'
51
- strict-transport-security:
52
- - max-age=15724800; includeSubDomains
53
- vary:
54
- - Origin
55
- access-control-allow-origin:
56
- - "*"
57
- access-control-allow-credentials:
58
- - 'true'
59
- access-control-allow-methods:
60
- - GET, PUT, POST, DELETE, PATCH, OPTIONS
61
- access-control-allow-headers:
62
- - DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
63
- body:
64
- encoding: UTF-8
65
- string: '{"data":{"id":"est_test_7b0f776934705a0cbbc33082ae85026a","order":{"id":"ord_test_9ff07c288ac6484ea64b8a7dd6139f0a","allocation_state":"allocated","allocations":[{"id":"all_test_946d0d85732a7d36e96202b2ba267339","mass_g":100,"offset":{"id":"off_test_000ef5de5218cc4eeea1f87e081da9cc","developer":"Patch
66
- Test Developer","production":false,"serial_number":"462630d75df3085670adfb97cc7be235","vintage_year":2020},"production":false}],"mass_g":100,"price_cents_usd":"1.0","production":false,"state":"draft"},"production":true,"type":"mass"},"error":null,"meta":null,"success":true}'
67
- http_version: '2'
68
- adapter_metadata:
69
- effective_url: https://api.staging-patch.com/v1/estimates/mass
70
- recorded_at: Thu, 02 Jul 2020 17:44:24 GMT
71
- - request:
72
- method: patch
73
- uri: https://api.staging-patch.com/v1/orders/ord_test_9ff07c288ac6484ea64b8a7dd6139f0a/place
74
- body:
75
- encoding: US-ASCII
76
- string: ''
77
- headers:
78
- User-Agent:
79
- - OpenAPI-Generator/1.0.0.pre/ruby
80
- Content-Type:
81
- - application/json
82
- Accept:
83
- - application/json
84
- Authorization:
85
- - "<AUTH>"
86
- Expect:
87
- - ''
88
- response:
89
- status:
90
- code: 200
91
- message: ''
92
- headers:
93
- server:
94
- - nginx/1.17.8
95
- date:
96
- - Thu, 02 Jul 2020 17:44:24 GMT
97
- content-type:
98
- - application/json; charset=utf-8
99
- vary:
100
- - Accept-Encoding
101
- - Origin
102
- x-frame-options:
103
- - SAMEORIGIN
104
- x-xss-protection:
105
- - 1; mode=block
106
- x-content-type-options:
107
- - nosniff
108
- x-download-options:
109
- - noopen
110
- x-permitted-cross-domain-policies:
111
- - none
112
- referrer-policy:
113
- - strict-origin-when-cross-origin
114
- etag:
115
- - W/"83cacd7a207ff94ca182623addf38a4a"
116
- cache-control:
117
- - max-age=0, private, must-revalidate
118
- x-request-id:
119
- - cf92e44ea1f6dac58c8dda2d9838d33c
120
- x-runtime:
121
- - '0.030993'
122
- strict-transport-security:
123
- - max-age=15724800; includeSubDomains
124
- access-control-allow-origin:
125
- - "*"
126
- access-control-allow-credentials:
127
- - 'true'
128
- access-control-allow-methods:
129
- - GET, PUT, POST, DELETE, PATCH, OPTIONS
130
- access-control-allow-headers:
131
- - DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
132
- body:
133
- encoding: UTF-8
134
- string: '{"data":{"id":"ord_test_9ff07c288ac6484ea64b8a7dd6139f0a","allocation_state":"allocated","allocations":[{"id":"all_test_946d0d85732a7d36e96202b2ba267339","mass_g":100,"offset":{"id":"off_test_000ef5de5218cc4eeea1f87e081da9cc","developer":"Patch
135
- Test Developer","production":false,"serial_number":"462630d75df3085670adfb97cc7be235","vintage_year":2020},"production":false}],"mass_g":100,"price_cents_usd":"1.0","production":false,"state":"placed"},"error":null,"meta":null,"success":true}'
136
- http_version: '2'
137
- adapter_metadata:
138
- effective_url: https://api.staging-patch.com/v1/orders/ord_test_9ff07c288ac6484ea64b8a7dd6139f0a/place
139
- recorded_at: Thu, 02 Jul 2020 17:44:24 GMT
140
- - request:
141
- method: post
142
- uri: https://api.staging-patch.com/v1/estimates/mass
143
- body:
144
- encoding: UTF-8
145
- string: '{"mass_g":100}'
146
- headers:
147
- User-Agent:
148
- - OpenAPI-Generator/1.0.0.pre/ruby
149
- Content-Type:
150
- - application/json
151
- Accept:
152
- - application/json
153
- Authorization:
154
- - "<AUTH>"
155
- Expect:
156
- - ''
157
- response:
158
- status:
159
- code: 201
160
- message: ''
161
- headers:
162
- server:
163
- - nginx/1.17.8
164
- date:
165
- - Thu, 02 Jul 2020 17:44:24 GMT
166
- content-type:
167
- - application/json; charset=utf-8
168
- x-frame-options:
169
- - SAMEORIGIN
170
- x-xss-protection:
171
- - 1; mode=block
172
- x-content-type-options:
173
- - nosniff
174
- x-download-options:
175
- - noopen
176
- x-permitted-cross-domain-policies:
177
- - none
178
- referrer-policy:
179
- - strict-origin-when-cross-origin
180
- etag:
181
- - W/"bbe846386f1301daf592dc1778dbf7aa"
182
- cache-control:
183
- - max-age=0, private, must-revalidate
184
- x-request-id:
185
- - 291f4b70d2f90defaecae12dd5d6f73b
186
- x-runtime:
187
- - '0.049709'
188
- strict-transport-security:
189
- - max-age=15724800; includeSubDomains
190
- vary:
191
- - Origin
192
- access-control-allow-origin:
193
- - "*"
194
- access-control-allow-credentials:
195
- - 'true'
196
- access-control-allow-methods:
197
- - GET, PUT, POST, DELETE, PATCH, OPTIONS
198
- access-control-allow-headers:
199
- - DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
200
- body:
201
- encoding: UTF-8
202
- string: '{"data":{"id":"est_test_6156c2c85627268bde56dc5dc13d6668","order":{"id":"ord_test_9a8e1b4894cce6420d21685cabcdfabe","allocation_state":"allocated","allocations":[{"id":"all_test_7883718e4e87879a6ad3e9c2a6afb719","mass_g":100,"offset":{"id":"off_test_000ef5de5218cc4eeea1f87e081da9cc","developer":"Patch
203
- Test Developer","production":false,"serial_number":"462630d75df3085670adfb97cc7be235","vintage_year":2020},"production":false}],"mass_g":100,"price_cents_usd":"1.0","production":false,"state":"draft"},"production":true,"type":"mass"},"error":null,"meta":null,"success":true}'
204
- http_version: '2'
205
- adapter_metadata:
206
- effective_url: https://api.staging-patch.com/v1/estimates/mass
207
- recorded_at: Thu, 02 Jul 2020 17:44:24 GMT
208
- - request:
209
- method: patch
210
- uri: https://api.staging-patch.com/v1/orders/ord_test_9a8e1b4894cce6420d21685cabcdfabe/cancel
211
- body:
212
- encoding: US-ASCII
213
- string: ''
214
- headers:
215
- User-Agent:
216
- - OpenAPI-Generator/1.0.0.pre/ruby
217
- Content-Type:
218
- - application/json
219
- Accept:
220
- - application/json
221
- Authorization:
222
- - "<AUTH>"
223
- Expect:
224
- - ''
225
- response:
226
- status:
227
- code: 200
228
- message: ''
229
- headers:
230
- server:
231
- - nginx/1.17.8
232
- date:
233
- - Thu, 02 Jul 2020 17:44:24 GMT
234
- content-type:
235
- - application/json; charset=utf-8
236
- vary:
237
- - Accept-Encoding
238
- - Origin
239
- x-frame-options:
240
- - SAMEORIGIN
241
- x-xss-protection:
242
- - 1; mode=block
243
- x-content-type-options:
244
- - nosniff
245
- x-download-options:
246
- - noopen
247
- x-permitted-cross-domain-policies:
248
- - none
249
- referrer-policy:
250
- - strict-origin-when-cross-origin
251
- etag:
252
- - W/"c9c14db6eaa851d90cefcb3766bee9d8"
253
- cache-control:
254
- - max-age=0, private, must-revalidate
255
- x-request-id:
256
- - 892abb438ef0bf9cae7ecee9156659a2
257
- x-runtime:
258
- - '0.027150'
259
- strict-transport-security:
260
- - max-age=15724800; includeSubDomains
261
- access-control-allow-origin:
262
- - "*"
263
- access-control-allow-credentials:
264
- - 'true'
265
- access-control-allow-methods:
266
- - GET, PUT, POST, DELETE, PATCH, OPTIONS
267
- access-control-allow-headers:
268
- - DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
269
- body:
270
- encoding: UTF-8
271
- string: '{"data":{"id":"ord_test_9a8e1b4894cce6420d21685cabcdfabe","allocation_state":"allocated","allocations":[],"mass_g":100,"price_cents_usd":"1.0","production":false,"state":"cancelled"},"error":null,"meta":null,"success":true}'
272
- http_version: '2'
273
- adapter_metadata:
274
- effective_url: https://api.staging-patch.com/v1/orders/ord_test_9a8e1b4894cce6420d21685cabcdfabe/cancel
275
- recorded_at: Thu, 02 Jul 2020 17:44:24 GMT
276
- recorded_with: VCR 6.0.0