chartmogul-ruby 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
  6. data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +82 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/changelog.md +8 -0
  14. data/chartmogul-ruby.gemspec +29 -0
  15. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
  16. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
  17. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
  18. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_custom_attributes.yml +80 -0
  19. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml +79 -0
  20. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_404_if_no_customers_found.yml +38 -0
  21. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_custom_attributes.yml +80 -0
  22. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_tags.yml +80 -0
  23. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +47 -0
  24. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +42 -0
  25. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +43 -0
  26. data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_custom_attributes.yml +82 -0
  27. data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_handles_a_422_response.yml +50 -0
  28. data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_interracts_with_the_API.yml +240 -0
  29. data/fixtures/vcr_cassettes/ChartMogul_Import_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +298 -0
  30. data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
  31. data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
  32. data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
  33. data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_handles_a_422_error.yml +51 -0
  34. data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml +152 -0
  35. data/fixtures/vcr_cassettes/ChartMogul_Import_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +340 -0
  36. data/fixtures/vcr_cassettes/ChartMogul_Import_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml +243 -0
  37. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
  38. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
  39. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
  40. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
  41. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
  42. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
  43. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml +41 -0
  44. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +41 -0
  45. data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +42 -0
  46. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
  47. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
  48. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
  49. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
  50. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
  51. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
  52. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml +42 -0
  53. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +42 -0
  54. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
  55. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
  56. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml +40 -0
  57. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml +40 -0
  58. data/lib/chartmogul.rb +77 -0
  59. data/lib/chartmogul/api/actions/all.rb +28 -0
  60. data/lib/chartmogul/api/actions/create.rb +39 -0
  61. data/lib/chartmogul/api/actions/custom.rb +42 -0
  62. data/lib/chartmogul/api/actions/destroy.rb +14 -0
  63. data/lib/chartmogul/api/actions/update.rb +19 -0
  64. data/lib/chartmogul/api_resource.rb +57 -0
  65. data/lib/chartmogul/concerns/entries.rb +37 -0
  66. data/lib/chartmogul/concerns/pageable.rb +14 -0
  67. data/lib/chartmogul/concerns/summary.rb +20 -0
  68. data/lib/chartmogul/config_attributes.rb +15 -0
  69. data/lib/chartmogul/configuration.rb +6 -0
  70. data/lib/chartmogul/enrichment/customer.rb +114 -0
  71. data/lib/chartmogul/errors/chartmogul_error.rb +19 -0
  72. data/lib/chartmogul/errors/configuration_error.rb +4 -0
  73. data/lib/chartmogul/errors/forbidden_error.rb +4 -0
  74. data/lib/chartmogul/errors/not_found_error.rb +4 -0
  75. data/lib/chartmogul/errors/resource_invalid_error.rb +4 -0
  76. data/lib/chartmogul/errors/schema_invalid_error.rb +4 -0
  77. data/lib/chartmogul/import/customer.rb +38 -0
  78. data/lib/chartmogul/import/customer_invoices.rb +40 -0
  79. data/lib/chartmogul/import/data_source.rb +19 -0
  80. data/lib/chartmogul/import/invoice.rb +64 -0
  81. data/lib/chartmogul/import/line_items/one_time.rb +25 -0
  82. data/lib/chartmogul/import/line_items/subscription.rb +31 -0
  83. data/lib/chartmogul/import/plan.rb +21 -0
  84. data/lib/chartmogul/import/subscription.rb +30 -0
  85. data/lib/chartmogul/import/transactions/payment.rb +26 -0
  86. data/lib/chartmogul/import/transactions/refund.rb +26 -0
  87. data/lib/chartmogul/metrics/activity.rb +32 -0
  88. data/lib/chartmogul/metrics/all_key_metrics.rb +25 -0
  89. data/lib/chartmogul/metrics/arpa.rb +19 -0
  90. data/lib/chartmogul/metrics/arr.rb +19 -0
  91. data/lib/chartmogul/metrics/asp.rb +19 -0
  92. data/lib/chartmogul/metrics/base.rb +56 -0
  93. data/lib/chartmogul/metrics/customer_churn_rate.rb +19 -0
  94. data/lib/chartmogul/metrics/customer_count.rb +19 -0
  95. data/lib/chartmogul/metrics/ltv.rb +19 -0
  96. data/lib/chartmogul/metrics/mrr.rb +26 -0
  97. data/lib/chartmogul/metrics/mrr_churn_rate.rb +19 -0
  98. data/lib/chartmogul/metrics/subscription.rb +35 -0
  99. data/lib/chartmogul/object.rb +119 -0
  100. data/lib/chartmogul/resource_path.rb +42 -0
  101. data/lib/chartmogul/summary.rb +7 -0
  102. data/lib/chartmogul/utils/hash_snake_caser.rb +50 -0
  103. data/lib/chartmogul/utils/json_parser.rb +11 -0
  104. data/lib/chartmogul/version.rb +3 -0
  105. metadata +232 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 529dca739484aeb6a86eda45196b8857bbae7097
4
+ data.tar.gz: 537fbba48ed5ecb97d90ffc90959d83d146fb221
5
+ SHA512:
6
+ metadata.gz: 8738197ba9ec6dce2964f6723217704caca2e683e4ce01aa412bdf57a5846ed57f88456e8f878a2d872e420530091ffbe2406034afa53ef8b952ca1db9f55a11
7
+ data.tar.gz: e4f44ace64b2165416f9652f2cca000046683d61ae00b69fa121817fe18b50a69670d064ef6c784c2bc94d0679118c1e1d90438cad7c443b7b6aac44e7f79c05
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ before_install: gem install bundler
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/metrics/mrr-churn-rate?end-date=2015-02-01&start-date=2015-01-01
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic YzU0NjYwNDU5ZTMzODBkYzUyNmVhYjNiZjlhZGIyOGQ6N2MyMDEzOTYzZjQ2NGZiMmQ3ZjVjOTJkZDZiMjk2NDQ=
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Fri, 01 Jul 2016 14:47:45 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '160'
29
+ connection:
30
+ - close
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"date":"2015-01-31","mrr-churn-rate":0.0},{"date":"2015-02-01","mrr-churn-rate":0.0}],"summary":{"current":0,"previous":0,"percentage-change":0.0}}'
38
+ http_version:
39
+ recorded_at: Fri, 01 Jul 2016 14:47:45 GMT
40
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/metrics/mrr-churn-rate?end-date=2015-02-01&start-date=2015-01-01
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic YzU0NjYwNDU5ZTMzODBkYzUyNmVhYjNiZjlhZGIyOGQ6N2MyMDEzOTYzZjQ2NGZiMmQ3ZjVjOTJkZDZiMjk2NDQ=
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Fri, 01 Jul 2016 14:47:44 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '160'
29
+ connection:
30
+ - close
31
+ status:
32
+ - 200 OK
33
+ access-control-allow-credentials:
34
+ - 'true'
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"entries":[{"date":"2015-01-31","mrr-churn-rate":0.0},{"date":"2015-02-01","mrr-churn-rate":0.0}],"summary":{"current":0,"previous":0,"percentage-change":0.0}}'
38
+ http_version:
39
+ recorded_at: Fri, 01 Jul 2016 14:47:44 GMT
40
+ recorded_with: VCR 3.0.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in chartmogul-ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 ChartMogul Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ <p align="center">
2
+ <a href="https://chartmogul.com"><img width="200" src="https://chartmogul.com/assets/img/logo.png"></a>
3
+ </p>
4
+
5
+ <h3 align="center">ChartMogul API Ruby Client</h3>
6
+
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
+
9
+ <p align="center"><img src="https://travis-ci.com/chartmogul/chartmogul-ruby.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master"></p>
10
+
11
+ <hr>
12
+
13
+ <p align="center">
14
+ <b><a href="#installation">Installation</a></b>
15
+ |
16
+ <b><a href="#usage">Usage</a></b>
17
+ |
18
+ <b><a href="#configuration">Configuration</a></b>
19
+ |
20
+ <b><a href="#development">Development</a></b>
21
+ |
22
+ <b><a href="#contributing">Contributing</a></b>
23
+ |
24
+ <b><a href="#license">License</a></b>
25
+ </p>
26
+
27
+ <hr>
28
+ <br>
29
+
30
+
31
+ ## Installation
32
+
33
+ Add this line to your application's Gemfile:
34
+
35
+ ```ruby
36
+ gem 'chartmogul-ruby'
37
+ ```
38
+
39
+ And then execute:
40
+
41
+ $ bundle
42
+
43
+ Or install it yourself as:
44
+
45
+ $ gem install chartmogul-ruby
46
+
47
+ ## Usage
48
+
49
+ See ChartMogul's [API documentation](https://dev.chartmogul.com).
50
+
51
+ ## Configuration
52
+
53
+ Configure `chartmogul-ruby` with your Account Token and Secret Key, available from the administration section of your ChartMogul account.
54
+
55
+ ```ruby
56
+ ChartMogul.account_token = '<Account key goes here>'
57
+ ChartMogul.secret_key = '<Secret key goes here>'
58
+ ```
59
+
60
+ ## Development
61
+
62
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
63
+
64
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
65
+
66
+ ## Contributing
67
+
68
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chartmogul/chartmogul-ruby.
69
+
70
+ ## License
71
+
72
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
73
+
74
+ ### The MIT License (MIT)
75
+
76
+ *Copyright (c) 2016 ChartMogul Ltd.*
77
+
78
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
79
+
80
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
81
+
82
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "chartmogul"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/changelog.md ADDED
@@ -0,0 +1,8 @@
1
+ # chartmogul-ruby Change Log
2
+
3
+
4
+ ## Version 0.1.1 - 4 July 2016
5
+ - Version bump after 0.1.0 pushed to RubyGems under incorrect account.
6
+
7
+ ## Version 0.1.0 - 4 July 2016
8
+ - Initial release with support for our Import, Enrichment and Metrics APIs.
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'chartmogul/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'chartmogul-ruby'
8
+ spec.version = ChartMogul::VERSION
9
+ spec.authors = ['Jason Langenauer']
10
+ spec.email = ['jason@chartmogul.com']
11
+
12
+ spec.summary = 'Chartmogul API Ruby Client'
13
+ spec.description = 'Official Ruby client for ChartMogul\'s API'
14
+ spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = 'exe'
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_dependency 'faraday', '~>0.9'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.11'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'vcr', '~> 3.0'
28
+ spec.add_development_dependency 'pry', '~> 0.10.3'
29
+ end
@@ -0,0 +1,189 @@
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":"Test Data Source"}'
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: 201
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Sun, 05 Jun 2016 17:02:43 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/"2cbdc42d67c582b8b8e9b5b649142c6d"
39
+ cache-control:
40
+ - max-age=0, private, must-revalidate
41
+ x-request-id:
42
+ - 8e251145-840a-4a38-ba7c-468416d00c7a
43
+ x-runtime:
44
+ - '0.195234'
45
+ strict-transport-security:
46
+ - max-age=15768000
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"uuid":"ds_9afd5143-3884-4977-9281-dbb5f15df461","name":"Test Data
50
+ Source","created_at":"2016-06-05T17:02:43.282Z","status":"never_imported"}'
51
+ http_version:
52
+ recorded_at: Sun, 05 Jun 2016 17:02:43 GMT
53
+ - request:
54
+ method: get
55
+ uri: https://api.chartmogul.com/v1/import/data_sources
56
+ body:
57
+ encoding: US-ASCII
58
+ string: ''
59
+ headers:
60
+ User-Agent:
61
+ - Faraday v0.9.1
62
+ Authorization:
63
+ - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
64
+ response:
65
+ status:
66
+ code: 200
67
+ message:
68
+ headers:
69
+ server:
70
+ - nginx/1.9.10
71
+ date:
72
+ - Sun, 05 Jun 2016 17:02:43 GMT
73
+ content-type:
74
+ - application/json; charset=utf-8
75
+ transfer-encoding:
76
+ - chunked
77
+ connection:
78
+ - close
79
+ x-frame-options:
80
+ - SAMEORIGIN
81
+ x-xss-protection:
82
+ - 1; mode=block
83
+ x-content-type-options:
84
+ - nosniff
85
+ etag:
86
+ - W/"8d1f4cac283a3aecfeea3e952b417e64"
87
+ cache-control:
88
+ - max-age=0, private, must-revalidate
89
+ x-request-id:
90
+ - a8ee9d0b-364e-4f70-a17f-bfb4883e6ba7
91
+ x-runtime:
92
+ - '0.264734'
93
+ strict-transport-security:
94
+ - max-age=15768000
95
+ body:
96
+ encoding: UTF-8
97
+ string: '{"data_sources":[{"uuid":"ds_9afd5143-3884-4977-9281-dbb5f15df461","name":"Test
98
+ Data Source","created_at":"2016-06-05T17:02:43.282Z","status":"never_imported"}]}'
99
+ http_version:
100
+ recorded_at: Sun, 05 Jun 2016 17:02:43 GMT
101
+ - request:
102
+ method: delete
103
+ uri: https://api.chartmogul.com/v1/import/data_sources/ds_9afd5143-3884-4977-9281-dbb5f15df461
104
+ body:
105
+ encoding: US-ASCII
106
+ string: ''
107
+ headers:
108
+ User-Agent:
109
+ - Faraday v0.9.1
110
+ Authorization:
111
+ - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
112
+ response:
113
+ status:
114
+ code: 204
115
+ message:
116
+ headers:
117
+ server:
118
+ - nginx/1.9.10
119
+ date:
120
+ - Sun, 05 Jun 2016 17:02:44 GMT
121
+ connection:
122
+ - close
123
+ x-frame-options:
124
+ - SAMEORIGIN
125
+ x-xss-protection:
126
+ - 1; mode=block
127
+ x-content-type-options:
128
+ - nosniff
129
+ cache-control:
130
+ - no-cache
131
+ x-request-id:
132
+ - 11210672-f1bf-4590-9db3-77894c7aa619
133
+ x-runtime:
134
+ - '0.008042'
135
+ strict-transport-security:
136
+ - max-age=15768000
137
+ body:
138
+ encoding: UTF-8
139
+ string: ''
140
+ http_version:
141
+ recorded_at: Sun, 05 Jun 2016 17:02:44 GMT
142
+ - request:
143
+ method: get
144
+ uri: https://api.chartmogul.com/v1/import/data_sources
145
+ body:
146
+ encoding: US-ASCII
147
+ string: ''
148
+ headers:
149
+ User-Agent:
150
+ - Faraday v0.9.1
151
+ Authorization:
152
+ - Basic ZTk5MGJkMjNmNTQzYWNjZGY3ZDg4Yjk2OWNiMzAwOWI6NWM4YThlY2UxMTFmYmE4NTE1MGVmNzBjYmZmM2I3ZWI=
153
+ response:
154
+ status:
155
+ code: 200
156
+ message:
157
+ headers:
158
+ server:
159
+ - nginx/1.9.10
160
+ date:
161
+ - Sun, 05 Jun 2016 17:02:54 GMT
162
+ content-type:
163
+ - application/json; charset=utf-8
164
+ transfer-encoding:
165
+ - chunked
166
+ connection:
167
+ - close
168
+ x-frame-options:
169
+ - SAMEORIGIN
170
+ x-xss-protection:
171
+ - 1; mode=block
172
+ x-content-type-options:
173
+ - nosniff
174
+ etag:
175
+ - W/"fff2ed4cc06b2b7851a2db975ef7e229"
176
+ cache-control:
177
+ - max-age=0, private, must-revalidate
178
+ x-request-id:
179
+ - 1340397d-947c-4483-a970-d3707ea5d8a3
180
+ x-runtime:
181
+ - '0.121280'
182
+ strict-transport-security:
183
+ - max-age=15768000
184
+ body:
185
+ encoding: UTF-8
186
+ string: '{"data_sources":[]}'
187
+ http_version:
188
+ recorded_at: Sun, 05 Jun 2016 17:02:54 GMT
189
+ recorded_with: VCR 3.0.3