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,62 @@
1
+ module ChartMogul
2
+ class Invoice < ChartMogul::Object
3
+ readonly_attr :uuid
4
+
5
+ writeable_attr :date, type: :time
6
+ writeable_attr :currency
7
+ writeable_attr :line_items, default: []
8
+ writeable_attr :transactions, default: []
9
+ writeable_attr :external_id
10
+ writeable_attr :due_date, type: :time
11
+
12
+ def serialize_line_items
13
+ line_items.map(&:serialize_for_write)
14
+ end
15
+
16
+ def serialize_transactions
17
+ transactions.map(&:serialize_for_write)
18
+ end
19
+
20
+ private
21
+
22
+ def set_line_items(line_items_attributes)
23
+ @line_items = line_items_attributes.map.with_index do |line_item_attributes, index|
24
+ existing_line_item = line_items[index]
25
+
26
+ if existing_line_item
27
+ existing_line_item.assign_all_attributes(line_item_attributes)
28
+ else
29
+ line_item_class(line_item_attributes[:type])
30
+ .new_from_json(line_item_attributes.merge(invoice_uuid: uuid))
31
+ end
32
+ end
33
+ end
34
+
35
+ def set_transactions(transactions_attributes)
36
+ @transactions = transactions_attributes.map.with_index do |transaction_attributes, index|
37
+ existing_transaction = transactions[index]
38
+
39
+ if existing_transaction
40
+ existing_transaction.assign_all_attributes(transaction_attributes)
41
+ else
42
+ transaction_class(transaction_attributes[:type])
43
+ .new_from_json(transaction_attributes.merge(invoice_uuid: uuid))
44
+ end
45
+ end
46
+ end
47
+
48
+ def line_item_class(type)
49
+ case type
50
+ when 'subscription' then ChartMogul::LineItems::Subscription
51
+ when 'one_time' then ChartMogul::LineItems::OneTime
52
+ end
53
+ end
54
+
55
+ def transaction_class(type)
56
+ case type
57
+ when 'payment' then ChartMogul::Transactions::Payment
58
+ when 'refund' then ChartMogul::Transactions::Refund
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,23 @@
1
+ module ChartMogul
2
+ module LineItems
3
+ class OneTime < ChartMogul::Object
4
+ readonly_attr :uuid
5
+
6
+ writeable_attr :type, default: 'one_time'
7
+ writeable_attr :amount_in_cents
8
+ writeable_attr :description
9
+ writeable_attr :quantity
10
+ writeable_attr :discount_amount_in_cents
11
+ writeable_attr :discount_code
12
+ writeable_attr :tax_amount_in_cents
13
+ writeable_attr :external_id
14
+
15
+ writeable_attr :invoice_uuid
16
+
17
+ def initialize(attributes = {})
18
+ super(attributes)
19
+ @type = 'one_time'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ module ChartMogul
2
+ module LineItems
3
+ class Subscription < ChartMogul::Object
4
+ readonly_attr :uuid
5
+
6
+ writeable_attr :type, default: 'subscription'
7
+ writeable_attr :subscription_external_id
8
+ writeable_attr :service_period_start, type: :time
9
+ writeable_attr :service_period_end, type: :time
10
+ writeable_attr :amount_in_cents
11
+ writeable_attr :cancelled_at, type: :time
12
+ writeable_attr :prorated
13
+ writeable_attr :quantity
14
+ writeable_attr :discount_amount_in_cents
15
+ writeable_attr :discount_code
16
+ writeable_attr :tax_amount_in_cents
17
+ writeable_attr :external_id
18
+
19
+ readonly_attr :subscription_uuid
20
+ writeable_attr :invoice_uuid
21
+ writeable_attr :plan_uuid
22
+
23
+ def initialize(attributes = {})
24
+ super(attributes)
25
+ @type = 'subscription'
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ module ChartMogul
2
+ class Ping < APIResource
3
+ set_resource_name 'Ping'
4
+ set_resource_path '/v1/ping'
5
+
6
+ readonly_attr :data
7
+
8
+ include API::Actions::Custom
9
+
10
+ def self.ping()
11
+ custom!(:get, '/v1/ping')
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,26 @@
1
+ module ChartMogul
2
+ class Plan < APIResource
3
+ set_resource_name 'Plan'
4
+ set_resource_path '/v1/plans'
5
+ set_resource_root_key :plans
6
+
7
+ readonly_attr :uuid
8
+
9
+ writeable_attr :name
10
+ writeable_attr :interval_count
11
+ writeable_attr :interval_unit
12
+ writeable_attr :external_id
13
+
14
+ writeable_attr :data_source_uuid
15
+
16
+ include API::Actions::All
17
+ include API::Actions::Create
18
+ include API::Actions::Update
19
+ include API::Actions::Destroy
20
+ include API::Actions::Custom
21
+
22
+ def self.retrieve(uuid)
23
+ custom!(:get, "/v1/plans/#{uuid}")
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,31 @@
1
+ module ChartMogul
2
+ class Subscription < APIResource
3
+ set_resource_name 'Subscription'
4
+ set_resource_path '/v1/import/customers/:customer_uuid/subscriptions'
5
+ set_resource_root_key :subscriptions
6
+
7
+ readonly_attr :uuid
8
+ readonly_attr :external_id
9
+ readonly_attr :cancellation_dates, default: []
10
+
11
+ readonly_attr :plan_uuid
12
+ readonly_attr :data_source_uuid
13
+
14
+ include API::Actions::All
15
+ include API::Actions::Custom
16
+
17
+ def set_cancellation_dates(cancellation_dates_array)
18
+ @cancellation_dates = cancellation_dates_array.map do |cancellation_date|
19
+ Time.parse(cancellation_date)
20
+ end
21
+ end
22
+
23
+ def cancel(cancelled_at)
24
+ custom!(:patch, "/v1/import/subscriptions/#{uuid}", cancelled_at: cancelled_at)
25
+ end
26
+
27
+ def self.all(customer_uuid, options = {})
28
+ super(options.merge(customer_uuid: customer_uuid))
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,24 @@
1
+ module ChartMogul
2
+ module Transactions
3
+ class Payment < APIResource
4
+ set_resource_name 'Payment Transaction'
5
+ set_resource_path '/v1/import/invoices/:invoice_uuid/transactions'
6
+
7
+ readonly_attr :uuid
8
+
9
+ writeable_attr :type, default: 'payment'
10
+ writeable_attr :date, type: :time
11
+ writeable_attr :result
12
+ writeable_attr :external_id
13
+
14
+ writeable_attr :invoice_uuid
15
+
16
+ def initialize(attributes = {})
17
+ super(attributes)
18
+ @type = 'payment'
19
+ end
20
+
21
+ include API::Actions::Create
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module ChartMogul
2
+ module Transactions
3
+ class Refund < APIResource
4
+ set_resource_name 'Refund Transaction'
5
+ set_resource_path '/v1/import/invoices/:invoice_uuid/transactions'
6
+
7
+ readonly_attr :uuid
8
+
9
+ writeable_attr :type, default: 'refund'
10
+ writeable_attr :date, type: :time
11
+ writeable_attr :result
12
+ writeable_attr :external_id
13
+
14
+ writeable_attr :invoice_uuid
15
+
16
+ def initialize(attributes = {})
17
+ super(attributes)
18
+ @type = 'refund'
19
+ end
20
+
21
+ include API::Actions::Create
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module ChartMogul
2
- VERSION = "0.1.4"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartmogul-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Langenauer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-10 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -112,12 +112,19 @@ files:
112
112
  - bin/setup
113
113
  - changelog.md
114
114
  - chartmogul-ruby.gemspec
115
+ - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml
116
+ - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml
117
+ - fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml
118
+ - fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml
119
+ - fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml
115
120
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml
116
121
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml
117
122
  - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml
123
+ - fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml
118
124
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_custom_attributes.yml
119
125
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml
120
126
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/merges_customers.yml
127
+ - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_401_if_invalid_credentials.yml
121
128
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_404_if_no_customers_found.yml
122
129
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml
123
130
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_custom_attributes.yml
@@ -127,18 +134,6 @@ files:
127
134
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml
128
135
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_custom_attributes.yml
129
136
  - fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_customer.yml
130
- - fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_handles_a_422_response.yml
131
- - fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_interracts_with_the_API.yml
132
- - fixtures/vcr_cassettes/ChartMogul_Import_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml
133
- - fixtures/vcr_cassettes/ChartMogul_Import_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml
134
- - fixtures/vcr_cassettes/ChartMogul_Import_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml
135
- - fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml
136
- - fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml
137
- - fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml
138
- - fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_handles_a_422_error.yml
139
- - fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml
140
- - fixtures/vcr_cassettes/ChartMogul_Import_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
141
- - fixtures/vcr_cassettes/ChartMogul_Import_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml
142
137
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
143
138
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml
144
139
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
@@ -160,6 +155,15 @@ files:
160
155
  - fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml
161
156
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml
162
157
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml
158
+ - fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml
159
+ - fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml
160
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml
161
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml
162
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml
163
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml
164
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml
165
+ - fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
166
+ - fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml
163
167
  - lib/chartmogul.rb
164
168
  - lib/chartmogul/api/actions/all.rb
165
169
  - lib/chartmogul/api/actions/create.rb
@@ -172,6 +176,9 @@ files:
172
176
  - lib/chartmogul/concerns/summary.rb
173
177
  - lib/chartmogul/config_attributes.rb
174
178
  - lib/chartmogul/configuration.rb
179
+ - lib/chartmogul/customer.rb
180
+ - lib/chartmogul/customer_invoices.rb
181
+ - lib/chartmogul/data_source.rb
175
182
  - lib/chartmogul/enrichment/customer.rb
176
183
  - lib/chartmogul/errors/chartmogul_error.rb
177
184
  - lib/chartmogul/errors/configuration_error.rb
@@ -179,16 +186,10 @@ files:
179
186
  - lib/chartmogul/errors/not_found_error.rb
180
187
  - lib/chartmogul/errors/resource_invalid_error.rb
181
188
  - lib/chartmogul/errors/schema_invalid_error.rb
182
- - lib/chartmogul/import/customer.rb
183
- - lib/chartmogul/import/customer_invoices.rb
184
- - lib/chartmogul/import/data_source.rb
185
- - lib/chartmogul/import/invoice.rb
186
- - lib/chartmogul/import/line_items/one_time.rb
187
- - lib/chartmogul/import/line_items/subscription.rb
188
- - lib/chartmogul/import/plan.rb
189
- - lib/chartmogul/import/subscription.rb
190
- - lib/chartmogul/import/transactions/payment.rb
191
- - lib/chartmogul/import/transactions/refund.rb
189
+ - lib/chartmogul/errors/unauthorized_error.rb
190
+ - lib/chartmogul/invoice.rb
191
+ - lib/chartmogul/line_items/one_time.rb
192
+ - lib/chartmogul/line_items/subscription.rb
192
193
  - lib/chartmogul/metrics/activity.rb
193
194
  - lib/chartmogul/metrics/all_key_metrics.rb
194
195
  - lib/chartmogul/metrics/arpa.rb
@@ -202,8 +203,13 @@ files:
202
203
  - lib/chartmogul/metrics/mrr_churn_rate.rb
203
204
  - lib/chartmogul/metrics/subscription.rb
204
205
  - lib/chartmogul/object.rb
206
+ - lib/chartmogul/ping.rb
207
+ - lib/chartmogul/plan.rb
205
208
  - lib/chartmogul/resource_path.rb
209
+ - lib/chartmogul/subscription.rb
206
210
  - lib/chartmogul/summary.rb
211
+ - lib/chartmogul/transactions/payment.rb
212
+ - lib/chartmogul/transactions/refund.rb
207
213
  - lib/chartmogul/utils/hash_snake_caser.rb
208
214
  - lib/chartmogul/utils/json_parser.rb
209
215
  - lib/chartmogul/version.rb
@@ -1,46 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: delete
5
- uri: https://api.chartmogul.com/v1/import/data_sources/1234-a-uuid-that-doesnt-exist
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.9.1
12
- Authorization:
13
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
14
- response:
15
- status:
16
- code: 404
17
- message:
18
- headers:
19
- server:
20
- - nginx/1.9.10
21
- date:
22
- - Sun, 05 Jun 2016 18:52:12 GMT
23
- content-type:
24
- - application/json; charset=utf-8
25
- transfer-encoding:
26
- - chunked
27
- connection:
28
- - close
29
- x-frame-options:
30
- - SAMEORIGIN
31
- x-xss-protection:
32
- - 1; mode=block
33
- x-content-type-options:
34
- - nosniff
35
- cache-control:
36
- - no-cache
37
- x-request-id:
38
- - dd910032-2b3d-4ce7-8caa-99c7bd562431
39
- x-runtime:
40
- - '0.007264'
41
- body:
42
- encoding: UTF-8
43
- string: '{"error":"Data source not found"}'
44
- http_version:
45
- recorded_at: Sun, 05 Jun 2016 18:52:12 GMT
46
- recorded_with: VCR 3.0.3
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.chartmogul.com/v1/import/data_sources
6
- body:
7
- encoding: UTF-8
8
- string: '{"name":null}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.9.1
12
- Content-Type:
13
- - application/json
14
- Authorization:
15
- - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
16
- response:
17
- status:
18
- code: 422
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.9.10
23
- date:
24
- - Sun, 05 Jun 2016 18:52:12 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
- cache-control:
38
- - no-cache
39
- x-request-id:
40
- - 2b95156f-88a2-4433-b949-e2233a546341
41
- x-runtime:
42
- - '0.014123'
43
- body:
44
- encoding: UTF-8
45
- string: '{"errors":{"name":"A name is required for each data source."}}'
46
- http_version:
47
- recorded_at: Sun, 05 Jun 2016 18:52:12 GMT
48
- recorded_with: VCR 3.0.3