chartmogul-ruby 0.1.4 → 1.0.0

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/.gitignore +1 -0
  3. data/README.md +11 -6
  4. data/bin/setup +1 -0
  5. data/changelog.md +4 -0
  6. data/fixtures/vcr_cassettes/{ChartMogul_Import_Customer → ChartMogul_Customer}/API_Interactions/correctly_handles_a_422_response.yml +3 -3
  7. data/fixtures/vcr_cassettes/{ChartMogul_Import_Customer → ChartMogul_Customer}/API_Interactions/correctly_interracts_with_the_API.yml +15 -15
  8. data/fixtures/vcr_cassettes/{ChartMogul_Import_Customer → ChartMogul_Customer}/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml +2 -2
  9. data/fixtures/vcr_cassettes/{ChartMogul_Import_Customer → ChartMogul_Customer}/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml +2 -2
  10. data/fixtures/vcr_cassettes/{ChartMogul_Import_CustomerInvoices → ChartMogul_CustomerInvoices}/API_Interactions/correctly_interracts_with_the_API.yml +4 -4
  11. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +12 -12
  12. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +3 -3
  13. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +3 -3
  14. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml +101 -0
  15. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_401_if_invalid_credentials.yml +38 -0
  16. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml +38 -0
  17. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml +38 -0
  18. data/fixtures/vcr_cassettes/{ChartMogul_Import_Plan/API_Interractions → ChartMogul_Plan/API_Interactions}/correctly_handles_a_422_error.yml +3 -3
  19. data/fixtures/vcr_cassettes/{ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml → ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml} +9 -9
  20. data/fixtures/vcr_cassettes/{ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml → ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml} +61 -52
  21. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml +151 -0
  22. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml +198 -0
  23. data/fixtures/vcr_cassettes/{ChartMogul_Import_Subscription → ChartMogul_Subscription}/API_Interactions/correctly_interracts_with_the_API.yml +4 -4
  24. data/fixtures/vcr_cassettes/{ChartMogul_Import_Transactions_Payment → ChartMogul_Transactions_Payment}/API_Interactions/correctly_interracts_with_the_API.yml +3 -3
  25. data/lib/chartmogul.rb +12 -11
  26. data/lib/chartmogul/api_resource.rb +12 -1
  27. data/lib/chartmogul/customer.rb +41 -0
  28. data/lib/chartmogul/customer_invoices.rb +42 -0
  29. data/lib/chartmogul/data_source.rb +22 -0
  30. data/lib/chartmogul/errors/unauthorized_error.rb +4 -0
  31. data/lib/chartmogul/invoice.rb +62 -0
  32. data/lib/chartmogul/line_items/one_time.rb +23 -0
  33. data/lib/chartmogul/line_items/subscription.rb +29 -0
  34. data/lib/chartmogul/ping.rb +14 -0
  35. data/lib/chartmogul/plan.rb +26 -0
  36. data/lib/chartmogul/subscription.rb +31 -0
  37. data/lib/chartmogul/transactions/payment.rb +24 -0
  38. data/lib/chartmogul/transactions/refund.rb +24 -0
  39. data/lib/chartmogul/version.rb +1 -1
  40. metadata +30 -24
  41. data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +0 -46
  42. data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +0 -48
  43. data/lib/chartmogul/import/customer.rb +0 -43
  44. data/lib/chartmogul/import/customer_invoices.rb +0 -44
  45. data/lib/chartmogul/import/data_source.rb +0 -19
  46. data/lib/chartmogul/import/invoice.rb +0 -64
  47. data/lib/chartmogul/import/line_items/one_time.rb +0 -25
  48. data/lib/chartmogul/import/line_items/subscription.rb +0 -31
  49. data/lib/chartmogul/import/plan.rb +0 -21
  50. data/lib/chartmogul/import/subscription.rb +0 -33
  51. data/lib/chartmogul/import/transactions/payment.rb +0 -26
  52. data/lib/chartmogul/import/transactions/refund.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac53d485cbc90316aea9203f60009924910ebf75
4
- data.tar.gz: dd519a0580ca04fe3062a563ae1438b2b1e1e4b7
3
+ metadata.gz: ce412c434fa9c0e2c8aadaa965a0aba174ee6a01
4
+ data.tar.gz: 4bede47b2164a1e84612c28c00448c722c62e52d
5
5
  SHA512:
6
- metadata.gz: 93e2005d1b3b1ba51c7144f9aa09212313131f9cd30bab06dd5fa9df743e0cdac9e07d195903e840873fa6b05c63c6903a15b8db98bf97d07726df874f189b9d
7
- data.tar.gz: 7f7ef08917f59d0e940c2141b1eda1e1d8b24485660dd0438e579c0f5d2e6680525faa6a8fffadaa4667f7e504e2d20109d8c73ddf5412088b3e06065d557bd1
6
+ metadata.gz: da97bdb7c0ede39393b571d47fb8247eee9cec893d9039bf9ac86aafb4a452f9f16bf450af99d1f123b6d7a34c2c2b7a9d72dafd64de48635a0f33373b15a45e
7
+ data.tar.gz: 38169294565b34419ad7d513d5805098b7e89fdd5e6b393edde5a6b733af6c9c4eb4aba85af76ebd4e33b0604a2d195741575238d87682334442de8b95dd2754
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.swp
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <p align="center"><code>chartmogul-ruby</code> provides convenient Ruby bindings for <a href="https://dev.chartmogul.com">ChartMogul's API</a>.</p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://badge.fury.io/rb/chartmogul-ruby"><img src="https://badge.fury.io/rb/chartmogul-ruby.svg" alt="Gem Version"></a>
10
+ <a href="https://badge.fury.io/rb/chartmogul-ruby"><img src="https://badge.fury.io/rb/chartmogul-ruby.svg" alt="Gem Version"></a>
11
11
  <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=master" alt="Travis project"></a>
12
12
  </p>
13
13
 
@@ -56,23 +56,28 @@ ChartMogul.account_token = '<Account key goes here>'
56
56
  ChartMogul.secret_key = '<Secret key goes here>'
57
57
  ```
58
58
 
59
+ Test your authentication:
60
+ ```ruby
61
+ ChartMogul::Ping.ping
62
+ ```
63
+
59
64
  ## Usage
60
65
 
61
66
  For example, to create a Data Source object,
62
67
 
63
68
  Request:
64
69
  ```ruby
65
- ChartMogul::Import::DataSource.create!(
70
+ ChartMogul::DataSource.create!(
66
71
  name: 'In-house billing'
67
72
  )
68
73
  ```
69
74
 
70
75
  Response:
71
76
  ```ruby
72
- #<ChartMogul::Import::DataSource:0x007ff9f127d628
73
- @name="In-house billing",
74
- @uuid="ds_cfc2b8f2-ad2c-4e3d-b64f-58d0bb282824",
75
- @status="never_imported",
77
+ #<ChartMogul::DataSource:0x007ff9f127d628
78
+ @name="In-house billing",
79
+ @uuid="ds_cfc2b8f2-ad2c-4e3d-b64f-58d0bb282824",
80
+ @status="never_imported",
76
81
  @created_at=2016-06-27 11:27:37 UTC
77
82
  >
78
83
  ```
data/bin/setup CHANGED
@@ -3,6 +3,7 @@ set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
+ gem install bundler
6
7
  bundle install
7
8
 
8
9
  # Do any other automated setup that you need to do here
data/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # chartmogul-ruby Change Log
2
2
 
3
+ ## Version 1.0.0 - 10 January 2017
4
+ - Add support for new plan and data source endpoints
5
+ - Remove deprecated Import namespace
6
+
3
7
  ## Version 0.1.4 - 10 November 2016
4
8
  - Add support for merging customers
5
9
  - Add support for updating customers
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/customers
5
+ uri: https://api.chartmogul.com/v1/customers
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data_source_uuid":null,"external_id":null,"name":null,"email":null,"company":null,"country":null,"state":null,"city":null,"zip":null}'
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 422
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx/1.9.10
@@ -45,6 +45,6 @@ http_interactions:
45
45
  string: '{"errors":{"external_id":"A unique external ID is required for each
46
46
  customer.","name":"A name is required for each customer.","data_source_uuid":"A
47
47
  valid data source UUID is required for each customer."}}'
48
- http_version:
48
+ http_version:
49
49
  recorded_at: Mon, 06 Jun 2016 15:26:39 GMT
50
50
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/data_sources
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":"Customer Test Data Source"}'
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 201
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx/1.10.1
@@ -48,11 +48,11 @@ http_interactions:
48
48
  encoding: UTF-8
49
49
  string: '{"uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa","name":"Customer
50
50
  Test Data Source","created_at":"2016-11-08T08:57:33.304Z","status":"never_imported"}'
51
- http_version:
51
+ http_version:
52
52
  recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
53
53
  - request:
54
54
  method: post
55
- uri: https://api.chartmogul.com/v1/import/customers
55
+ uri: https://api.chartmogul.com/v1/customers
56
56
  body:
57
57
  encoding: UTF-8
58
58
  string: '{"external_id":"X1234","name":"Test Customer","email":"test@example.com","country":"DE","city":"Berlin","data_source_uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa","lead_created_at":"2016-10-01
@@ -67,7 +67,7 @@ http_interactions:
67
67
  response:
68
68
  status:
69
69
  code: 201
70
- message:
70
+ message:
71
71
  headers:
72
72
  server:
73
73
  - nginx/1.10.1
@@ -99,11 +99,11 @@ http_interactions:
99
99
  encoding: UTF-8
100
100
  string: '{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
101
101
  Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","data_source_uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa"}'
102
- http_version:
102
+ http_version:
103
103
  recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
104
104
  - request:
105
105
  method: get
106
- uri: https://api.chartmogul.com/v1/import/customers
106
+ uri: https://api.chartmogul.com/v1/customers
107
107
  body:
108
108
  encoding: US-ASCII
109
109
  string: ''
@@ -117,7 +117,7 @@ http_interactions:
117
117
  response:
118
118
  status:
119
119
  code: 200
120
- message:
120
+ message:
121
121
  headers:
122
122
  server:
123
123
  - nginx/1.10.1
@@ -149,11 +149,11 @@ http_interactions:
149
149
  encoding: UTF-8
150
150
  string: '{"customers":[{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
151
151
  Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","data_source_uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa"}],"current_page":1,"total_pages":1}'
152
- http_version:
152
+ http_version:
153
153
  recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
154
154
  - request:
155
155
  method: delete
156
- uri: https://api.chartmogul.com/v1/import/customers/cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16
156
+ uri: https://api.chartmogul.com/v1/customers/cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16
157
157
  body:
158
158
  encoding: US-ASCII
159
159
  string: ''
@@ -165,7 +165,7 @@ http_interactions:
165
165
  response:
166
166
  status:
167
167
  code: 204
168
- message:
168
+ message:
169
169
  headers:
170
170
  server:
171
171
  - nginx/1.10.1
@@ -190,11 +190,11 @@ http_interactions:
190
190
  body:
191
191
  encoding: UTF-8
192
192
  string: ''
193
- http_version:
193
+ http_version:
194
194
  recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
195
195
  - request:
196
196
  method: get
197
- uri: https://api.chartmogul.com/v1/import/customers
197
+ uri: https://api.chartmogul.com/v1/customers
198
198
  body:
199
199
  encoding: US-ASCII
200
200
  string: ''
@@ -208,7 +208,7 @@ http_interactions:
208
208
  response:
209
209
  status:
210
210
  code: 200
211
- message:
211
+ message:
212
212
  headers:
213
213
  server:
214
214
  - nginx/1.10.1
@@ -239,6 +239,6 @@ http_interactions:
239
239
  body:
240
240
  encoding: UTF-8
241
241
  string: '{"customers":[],"current_page":1,"total_pages":0}'
242
- http_version:
242
+ http_version:
243
243
  recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
244
244
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/customers
5
+ uri: https://api.chartmogul.com/v1/customers
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85","external_id":"X1234","name":"Test
@@ -53,7 +53,7 @@ http_interactions:
53
53
  recorded_at: Mon, 06 Jun 2016 15:26:39 GMT
54
54
  - request:
55
55
  method: get
56
- uri: https://api.chartmogul.com/v1/import/customers?external_id=X1234
56
+ uri: https://api.chartmogul.com/v1/customers?external_id=X1234
57
57
  body:
58
58
  encoding: US-ASCII
59
59
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/customers
5
+ uri: https://api.chartmogul.com/v1/customers
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85","external_id":"X1234","name":"Test
@@ -53,7 +53,7 @@ http_interactions:
53
53
  recorded_at: Mon, 06 Jun 2016 15:26:39 GMT
54
54
  - request:
55
55
  method: get
56
- uri: https://api.chartmogul.com/v1/import/customers?external_id=nope
56
+ uri: https://api.chartmogul.com/v1/customers?external_id=nope
57
57
  body:
58
58
  encoding: US-ASCII
59
59
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/data_sources
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":"Customer Invoices Test Data Source"}'
@@ -52,7 +52,7 @@ http_interactions:
52
52
  recorded_at: Wed, 22 Jun 2016 15:34:41 GMT
53
53
  - request:
54
54
  method: post
55
- uri: https://api.chartmogul.com/v1/import/customers
55
+ uri: https://api.chartmogul.com/v1/customers
56
56
  body:
57
57
  encoding: UTF-8
58
58
  string: '{"data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e","external_id":"test_cus_ext_id","name":"Test
@@ -103,7 +103,7 @@ http_interactions:
103
103
  recorded_at: Wed, 22 Jun 2016 15:34:41 GMT
104
104
  - request:
105
105
  method: post
106
- uri: https://api.chartmogul.com/v1/import/plans
106
+ uri: https://api.chartmogul.com/v1/plans
107
107
  body:
108
108
  encoding: UTF-8
109
109
  string: '{"data_source_uuid":"ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e","name":"Test
@@ -256,7 +256,7 @@ http_interactions:
256
256
  recorded_at: Wed, 22 Jun 2016 16:08:43 GMT
257
257
  - request:
258
258
  method: delete
259
- uri: https://api.chartmogul.com/v1/import/data_sources/ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e
259
+ uri: https://api.chartmogul.com/v1/data_sources/ds_9fb17361-f24c-4c13-a25d-4c08fbc7132e
260
260
  body:
261
261
  encoding: US-ASCII
262
262
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/data_sources
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":"Test Data Source"}'
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 201
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx/1.9.10
@@ -48,11 +48,11 @@ http_interactions:
48
48
  encoding: UTF-8
49
49
  string: '{"uuid":"ds_9afd5143-3884-4977-9281-dbb5f15df461","name":"Test Data
50
50
  Source","created_at":"2016-06-05T17:02:43.282Z","status":"never_imported"}'
51
- http_version:
51
+ http_version:
52
52
  recorded_at: Sun, 05 Jun 2016 17:02:43 GMT
53
53
  - request:
54
54
  method: get
55
- uri: https://api.chartmogul.com/v1/import/data_sources
55
+ uri: https://api.chartmogul.com/v1/data_sources
56
56
  body:
57
57
  encoding: US-ASCII
58
58
  string: ''
@@ -64,7 +64,7 @@ http_interactions:
64
64
  response:
65
65
  status:
66
66
  code: 200
67
- message:
67
+ message:
68
68
  headers:
69
69
  server:
70
70
  - nginx/1.9.10
@@ -96,11 +96,11 @@ http_interactions:
96
96
  encoding: UTF-8
97
97
  string: '{"data_sources":[{"uuid":"ds_9afd5143-3884-4977-9281-dbb5f15df461","name":"Test
98
98
  Data Source","created_at":"2016-06-05T17:02:43.282Z","status":"never_imported"}]}'
99
- http_version:
99
+ http_version:
100
100
  recorded_at: Sun, 05 Jun 2016 17:02:43 GMT
101
101
  - request:
102
102
  method: delete
103
- uri: https://api.chartmogul.com/v1/import/data_sources/ds_9afd5143-3884-4977-9281-dbb5f15df461
103
+ uri: https://api.chartmogul.com/v1/data_sources/ds_9afd5143-3884-4977-9281-dbb5f15df461
104
104
  body:
105
105
  encoding: US-ASCII
106
106
  string: ''
@@ -112,7 +112,7 @@ http_interactions:
112
112
  response:
113
113
  status:
114
114
  code: 204
115
- message:
115
+ message:
116
116
  headers:
117
117
  server:
118
118
  - nginx/1.9.10
@@ -137,11 +137,11 @@ http_interactions:
137
137
  body:
138
138
  encoding: UTF-8
139
139
  string: ''
140
- http_version:
140
+ http_version:
141
141
  recorded_at: Sun, 05 Jun 2016 17:02:44 GMT
142
142
  - request:
143
143
  method: get
144
- uri: https://api.chartmogul.com/v1/import/data_sources
144
+ uri: https://api.chartmogul.com/v1/data_sources
145
145
  body:
146
146
  encoding: US-ASCII
147
147
  string: ''
@@ -153,7 +153,7 @@ http_interactions:
153
153
  response:
154
154
  status:
155
155
  code: 200
156
- message:
156
+ message:
157
157
  headers:
158
158
  server:
159
159
  - nginx/1.9.10
@@ -184,6 +184,6 @@ http_interactions:
184
184
  body:
185
185
  encoding: UTF-8
186
186
  string: '{"data_sources":[]}'
187
- http_version:
187
+ http_version:
188
188
  recorded_at: Sun, 05 Jun 2016 17:02:54 GMT
189
189
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://api.chartmogul.com/v1/import/data_sources/1234-a-uuid-that-doesnt-exist
5
+ uri: https://api.chartmogul.com/v1/data_sources/1234-a-uuid-that-doesnt-exist
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -14,7 +14,7 @@ http_interactions:
14
14
  response:
15
15
  status:
16
16
  code: 404
17
- message:
17
+ message:
18
18
  headers:
19
19
  server:
20
20
  - nginx/1.9.10
@@ -41,6 +41,6 @@ http_interactions:
41
41
  body:
42
42
  encoding: UTF-8
43
43
  string: '{"error":"Data source not found"}'
44
- http_version:
44
+ http_version:
45
45
  recorded_at: Sun, 05 Jun 2016 17:05:01 GMT
46
46
  recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://api.chartmogul.com/v1/import/data_sources
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":null}'
@@ -16,7 +16,7 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 422
19
- message:
19
+ message:
20
20
  headers:
21
21
  server:
22
22
  - nginx/1.9.10
@@ -43,6 +43,6 @@ http_interactions:
43
43
  body:
44
44
  encoding: UTF-8
45
45
  string: '{"errors":{"name":"A name is required for each data source."}}'
46
- http_version:
46
+ http_version:
47
47
  recorded_at: Sun, 05 Jun 2016 17:04:50 GMT
48
48
  recorded_with: VCR 3.0.3
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"TestDS"}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.10.0
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
16
+ response:
17
+ status:
18
+ code: 201
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Sun, 05 Jun 2016 18:52:01 GMT
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - close
31
+ x-frame-options:
32
+ - SAMEORIGIN
33
+ x-xss-protection:
34
+ - 1; mode=block
35
+ x-content-type-options:
36
+ - nosniff
37
+ etag:
38
+ - W/"5621b5bd639d8cf3876eddd3c3617ee5"
39
+ cache-control:
40
+ - max-age=0, private, must-revalidate
41
+ x-request-id:
42
+ - 67b3f0f2-9b9a-4bae-b631-578db1d7158b
43
+ x-runtime:
44
+ - '0.435113'
45
+ strict-transport-security:
46
+ - max-age=15768000
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"uuid":"ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072","name":"TestDS","created_at":"2016-06-05T18:52:00.931Z","status":"never_imported"}'
50
+ http_version:
51
+ recorded_at: Tue, 03 Jan 2017 22:49:40 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://api.chartmogul.com/v1/data_sources/ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072
55
+ body:
56
+ encoding: UTF-8
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.10.0
61
+ Content-Type:
62
+ - application/json
63
+ Authorization:
64
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
65
+ response:
66
+ status:
67
+ code: 200
68
+ message:
69
+ headers:
70
+ server:
71
+ - nginx/1.9.10
72
+ date:
73
+ - Sun, 05 Jun 2016 18:52:01 GMT
74
+ content-type:
75
+ - application/json; charset=utf-8
76
+ transfer-encoding:
77
+ - chunked
78
+ connection:
79
+ - close
80
+ x-frame-options:
81
+ - SAMEORIGIN
82
+ x-xss-protection:
83
+ - 1; mode=block
84
+ x-content-type-options:
85
+ - nosniff
86
+ etag:
87
+ - W/"5621b5bd639d8cf3876eddd3c3617ee5"
88
+ cache-control:
89
+ - max-age=0, private, must-revalidate
90
+ x-request-id:
91
+ - 67b3f0f2-9b9a-4bae-b631-578db1d7158b
92
+ x-runtime:
93
+ - '0.435113'
94
+ strict-transport-security:
95
+ - max-age=15768000
96
+ body:
97
+ encoding: UTF-8
98
+ string: '{"uuid":"ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072","name":"TestDS","system": "Import API", "created_at":"2016-06-05T18:52:00.931Z","status":"never_imported"}'
99
+ http_version:
100
+ recorded_at: Tue, 03 Jan 2017 22:49:40 GMT
101
+ recorded_with: VCR 3.0.3