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
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/customers?per_page=10
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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: 401
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Wed, 28 Dec 2016 17:04:19 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '63'
29
+ connection:
30
+ - close
31
+ status:
32
+ - 401 Unauthorized
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
36
+ http_version:
37
+ recorded_at: Wed, 28 Dec 2016 17:04:19 GMT
38
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.11.0
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
16
+ response:
17
+ status:
18
+ code: 401
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 13 Feb 2017 15:09:26 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '63'
29
+ connection:
30
+ - close
31
+ status:
32
+ - 401 Unauthorized
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
36
+ http_version:
37
+ recorded_at: Mon, 13 Feb 2017 15:09:28 GMT
38
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/ping
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.11.0
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Mon, 13 Feb 2017 15:04:03 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '16'
29
+ connection:
30
+ - close
31
+ status:
32
+ - 200 OK
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"data":"pong!"}'
36
+ http_version:
37
+ recorded_at: Mon, 13 Feb 2017 15:04:05 GMT
38
+ 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/plans
5
+ uri: https://api.chartmogul.com/v1/plans
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data_source_uuid":null,"name":null,"interval_count":null,"interval_unit":null,"external_id":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
@@ -46,6 +46,6 @@ http_interactions:
46
46
  not a number","interval_unit":"Only ''day'', ''month'' or ''year'' are valid
47
47
  values for interval_unit.","data_source_uuid":"A valid data source UUID is
48
48
  required for each plan."}}'
49
- http_version:
49
+ http_version:
50
50
  recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
51
51
  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":"Another 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_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data
50
50
  Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}'
51
- http_version:
51
+ http_version:
52
52
  recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
53
53
  - request:
54
54
  method: post
55
- uri: https://api.chartmogul.com/v1/import/plans
55
+ uri: https://api.chartmogul.com/v1/plans
56
56
  body:
57
57
  encoding: UTF-8
58
58
  string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A
@@ -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.9.10
@@ -99,11 +99,11 @@ http_interactions:
99
99
  encoding: UTF-8
100
100
  string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A
101
101
  Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}'
102
- http_version:
102
+ http_version:
103
103
  recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
104
104
  - request:
105
105
  method: get
106
- uri: https://api.chartmogul.com/v1/import/plans
106
+ uri: https://api.chartmogul.com/v1/plans
107
107
  body:
108
108
  encoding: US-ASCII
109
109
  string: ''
@@ -115,7 +115,7 @@ http_interactions:
115
115
  response:
116
116
  status:
117
117
  code: 200
118
- message:
118
+ message:
119
119
  headers:
120
120
  server:
121
121
  - nginx/1.9.10
@@ -147,6 +147,6 @@ http_interactions:
147
147
  encoding: UTF-8
148
148
  string: '{"plans":[{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A
149
149
  Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}],"current_page":1,"total_pages":1}'
150
- http_version:
150
+ http_version:
151
151
  recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
152
152
  recorded_with: VCR 3.0.3
@@ -2,26 +2,26 @@
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
- string: '{"name":"Test Data Source"}'
8
+ string: '{"name":"Another Data Source"}'
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.1
11
+ - Faraday v0.10.0
12
12
  Content-Type:
13
13
  - application/json
14
14
  Authorization:
15
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
15
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
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
23
23
  date:
24
- - Sun, 05 Jun 2016 18:52:01 GMT
24
+ - Sun, 05 Jun 2016 19:47:08 GMT
25
25
  content-type:
26
26
  - application/json; charset=utf-8
27
27
  transfer-encoding:
@@ -35,41 +35,44 @@ http_interactions:
35
35
  x-content-type-options:
36
36
  - nosniff
37
37
  etag:
38
- - W/"5621b5bd639d8cf3876eddd3c3617ee5"
38
+ - W/"05335923b74e9c38a5a5fe8e83ac0f79"
39
39
  cache-control:
40
40
  - max-age=0, private, must-revalidate
41
41
  x-request-id:
42
- - 67b3f0f2-9b9a-4bae-b631-578db1d7158b
42
+ - e163c0c6-e937-4427-a0c8-78bd5e3f1711
43
43
  x-runtime:
44
- - '0.435113'
44
+ - '0.509776'
45
45
  strict-transport-security:
46
46
  - max-age=15768000
47
47
  body:
48
48
  encoding: UTF-8
49
- string: '{"uuid":"ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072","name":"Test Data
50
- Source","created_at":"2016-06-05T18:52:00.931Z","status":"never_imported"}'
51
- http_version:
52
- recorded_at: Sun, 05 Jun 2016 18:52:01 GMT
49
+ string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data
50
+ Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}'
51
+ http_version:
52
+ recorded_at: Wed, 04 Jan 2017 02:32:48 GMT
53
53
  - request:
54
- method: get
55
- uri: https://api.chartmogul.com/v1/import/data_sources
54
+ method: post
55
+ uri: https://api.chartmogul.com/v1/plans
56
56
  body:
57
- encoding: US-ASCII
58
- string: ''
57
+ encoding: UTF-8
58
+ string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A
59
+ Test Plan","interval_count":1,"interval_unit":"month","external_id":null}'
59
60
  headers:
60
61
  User-Agent:
61
62
  - Faraday v0.9.1
63
+ Content-Type:
64
+ - application/json
62
65
  Authorization:
63
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
66
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
64
67
  response:
65
68
  status:
66
- code: 200
67
- message:
69
+ code: 201
70
+ message:
68
71
  headers:
69
72
  server:
70
73
  - nginx/1.9.10
71
74
  date:
72
- - Sun, 05 Jun 2016 18:52:01 GMT
75
+ - Sun, 05 Jun 2016 19:47:08 GMT
73
76
  content-type:
74
77
  - application/json; charset=utf-8
75
78
  transfer-encoding:
@@ -83,24 +86,24 @@ http_interactions:
83
86
  x-content-type-options:
84
87
  - nosniff
85
88
  etag:
86
- - W/"1fdf50f6c3b08eb62b8a2c10956df8f5"
89
+ - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8"
87
90
  cache-control:
88
91
  - max-age=0, private, must-revalidate
89
92
  x-request-id:
90
- - 5c425737-67c3-484a-aa67-ebf4bebd81d5
93
+ - 6e97fa02-8bc1-4d2f-8718-8473a58e4254
91
94
  x-runtime:
92
- - '0.110555'
95
+ - '0.120821'
93
96
  strict-transport-security:
94
97
  - max-age=15768000
95
98
  body:
96
99
  encoding: UTF-8
97
- string: '{"data_sources":[{"uuid":"ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072","name":"Test
98
- Data Source","created_at":"2016-06-05T18:52:00.931Z","status":"never_imported"}]}'
99
- http_version:
100
- recorded_at: Sun, 05 Jun 2016 18:52:01 GMT
100
+ string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A
101
+ Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}'
102
+ http_version:
103
+ recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
101
104
  - request:
102
- method: delete
103
- uri: https://api.chartmogul.com/v1/import/data_sources/ds_5ee8bf93-b0b4-4722-8a17-6b624a3af072
105
+ method: get
106
+ uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072
104
107
  body:
105
108
  encoding: US-ASCII
106
109
  string: ''
@@ -108,16 +111,20 @@ http_interactions:
108
111
  User-Agent:
109
112
  - Faraday v0.9.1
110
113
  Authorization:
111
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
114
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
112
115
  response:
113
116
  status:
114
- code: 204
115
- message:
117
+ code: 404
118
+ message:
116
119
  headers:
117
120
  server:
118
121
  - nginx/1.9.10
119
122
  date:
120
- - Sun, 05 Jun 2016 18:52:01 GMT
123
+ - Sun, 05 Jun 2016 19:47:08 GMT
124
+ content-type:
125
+ - application/json; charset=utf-8
126
+ transfer-encoding:
127
+ - chunked
121
128
  connection:
122
129
  - close
123
130
  x-frame-options:
@@ -126,22 +133,24 @@ http_interactions:
126
133
  - 1; mode=block
127
134
  x-content-type-options:
128
135
  - nosniff
136
+ etag:
137
+ - W/"2122e94312ef92cc077db62910743655"
129
138
  cache-control:
130
- - no-cache
139
+ - max-age=0, private, must-revalidate
131
140
  x-request-id:
132
- - 006ca269-ad29-4f54-9af5-adacd2fc917a
141
+ - 1286c5a2-596a-4bc2-9e24-cfccc393e589
133
142
  x-runtime:
134
- - '0.021315'
143
+ - '0.018019'
135
144
  strict-transport-security:
136
145
  - max-age=15768000
137
146
  body:
138
147
  encoding: UTF-8
139
- string: ''
140
- http_version:
141
- recorded_at: Sun, 05 Jun 2016 18:52:01 GMT
148
+ string: '{"error": "Plan not found"}'
149
+ http_version:
150
+ recorded_at: Wed, 04 Jan 2017 02:32:48 GMT
142
151
  - request:
143
- method: get
144
- uri: https://api.chartmogul.com/v1/import/data_sources
152
+ method: delete
153
+ uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072
145
154
  body:
146
155
  encoding: US-ASCII
147
156
  string: ''
@@ -149,16 +158,16 @@ http_interactions:
149
158
  User-Agent:
150
159
  - Faraday v0.9.1
151
160
  Authorization:
152
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
161
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
153
162
  response:
154
163
  status:
155
- code: 200
156
- message:
164
+ code: 204
165
+ message:
157
166
  headers:
158
167
  server:
159
168
  - nginx/1.9.10
160
169
  date:
161
- - Sun, 05 Jun 2016 18:52:11 GMT
170
+ - Sun, 05 Jun 2016 19:47:08 GMT
162
171
  content-type:
163
172
  - application/json; charset=utf-8
164
173
  transfer-encoding:
@@ -172,18 +181,18 @@ http_interactions:
172
181
  x-content-type-options:
173
182
  - nosniff
174
183
  etag:
175
- - W/"fff2ed4cc06b2b7851a2db975ef7e229"
184
+ - W/"2122e94312ef92cc077db62910743655"
176
185
  cache-control:
177
186
  - max-age=0, private, must-revalidate
178
187
  x-request-id:
179
- - 5a92cbd3-d30a-4900-8922-28d828cd76c1
188
+ - 1286c5a2-596a-4bc2-9e24-cfccc393e589
180
189
  x-runtime:
181
- - '0.159925'
190
+ - '0.018019'
182
191
  strict-transport-security:
183
192
  - max-age=15768000
184
193
  body:
185
194
  encoding: UTF-8
186
- string: '{"data_sources":[]}'
187
- http_version:
188
- recorded_at: Sun, 05 Jun 2016 18:52:11 GMT
195
+ string: '{}'
196
+ http_version:
197
+ recorded_at: Wed, 04 Jan 2017 02:32:48 GMT
189
198
  recorded_with: VCR 3.0.3
@@ -0,0 +1,151 @@
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":"Another Data Source"}'
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 19:47:08 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/"05335923b74e9c38a5a5fe8e83ac0f79"
39
+ cache-control:
40
+ - max-age=0, private, must-revalidate
41
+ x-request-id:
42
+ - e163c0c6-e937-4427-a0c8-78bd5e3f1711
43
+ x-runtime:
44
+ - '0.509776'
45
+ strict-transport-security:
46
+ - max-age=15768000
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data
50
+ Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}'
51
+ http_version:
52
+ recorded_at: Tue, 03 Jan 2017 23:45:27 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://api.chartmogul.com/v1/plans
56
+ body:
57
+ encoding: UTF-8
58
+ string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A
59
+ Test Plan","interval_count":1,"interval_unit":"month","external_id":null}'
60
+ headers:
61
+ User-Agent:
62
+ - Faraday v0.9.1
63
+ Content-Type:
64
+ - application/json
65
+ Authorization:
66
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
67
+ response:
68
+ status:
69
+ code: 201
70
+ message:
71
+ headers:
72
+ server:
73
+ - nginx/1.9.10
74
+ date:
75
+ - Sun, 05 Jun 2016 19:47:08 GMT
76
+ content-type:
77
+ - application/json; charset=utf-8
78
+ transfer-encoding:
79
+ - chunked
80
+ connection:
81
+ - close
82
+ x-frame-options:
83
+ - SAMEORIGIN
84
+ x-xss-protection:
85
+ - 1; mode=block
86
+ x-content-type-options:
87
+ - nosniff
88
+ etag:
89
+ - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8"
90
+ cache-control:
91
+ - max-age=0, private, must-revalidate
92
+ x-request-id:
93
+ - 6e97fa02-8bc1-4d2f-8718-8473a58e4254
94
+ x-runtime:
95
+ - '0.120821'
96
+ strict-transport-security:
97
+ - max-age=15768000
98
+ body:
99
+ encoding: UTF-8
100
+ string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A
101
+ Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}'
102
+ http_version:
103
+ recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
104
+ - request:
105
+ method: get
106
+ uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072
107
+ body:
108
+ encoding: US-ASCII
109
+ string: ''
110
+ headers:
111
+ User-Agent:
112
+ - Faraday v0.9.1
113
+ Authorization:
114
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
115
+ response:
116
+ status:
117
+ code: 200
118
+ message:
119
+ headers:
120
+ server:
121
+ - nginx/1.9.10
122
+ date:
123
+ - Sun, 05 Jun 2016 19:47:08 GMT
124
+ content-type:
125
+ - application/json; charset=utf-8
126
+ transfer-encoding:
127
+ - chunked
128
+ connection:
129
+ - close
130
+ x-frame-options:
131
+ - SAMEORIGIN
132
+ x-xss-protection:
133
+ - 1; mode=block
134
+ x-content-type-options:
135
+ - nosniff
136
+ etag:
137
+ - W/"2122e94312ef92cc077db62910743655"
138
+ cache-control:
139
+ - max-age=0, private, must-revalidate
140
+ x-request-id:
141
+ - 1286c5a2-596a-4bc2-9e24-cfccc393e589
142
+ x-runtime:
143
+ - '0.018019'
144
+ strict-transport-security:
145
+ - max-age=15768000
146
+ body:
147
+ encoding: UTF-8
148
+ string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}'
149
+ http_version:
150
+ recorded_at: Sun, 05 Jun 2016 19:47:08 GMT
151
+ recorded_with: VCR 3.0.3