chartmogul-ruby 1.4.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -1
  3. data/Gemfile +2 -0
  4. data/LICENSE.txt +1 -1
  5. data/README.md +5 -3
  6. data/Rakefile +2 -0
  7. data/bin/console +1 -0
  8. data/changelog.md +3 -0
  9. data/chartmogul-ruby.gemspec +14 -11
  10. data/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml +112 -0
  11. data/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml +77 -0
  12. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml +53 -0
  13. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml +164 -0
  14. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml +50 -0
  15. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml +293 -0
  16. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml +251 -0
  17. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml +357 -0
  18. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml +304 -0
  19. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml +297 -0
  20. data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml +411 -0
  21. data/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml +252 -0
  22. data/lib/chartmogul.rb +9 -2
  23. data/lib/chartmogul/api/actions/all.rb +2 -0
  24. data/lib/chartmogul/api/actions/create.rb +2 -0
  25. data/lib/chartmogul/api/actions/custom.rb +2 -0
  26. data/lib/chartmogul/api/actions/destroy.rb +2 -0
  27. data/lib/chartmogul/api/actions/retrieve.rb +2 -0
  28. data/lib/chartmogul/api/actions/update.rb +22 -0
  29. data/lib/chartmogul/api_resource.rb +21 -12
  30. data/lib/chartmogul/concerns/entries.rb +2 -0
  31. data/lib/chartmogul/concerns/pageable.rb +2 -0
  32. data/lib/chartmogul/concerns/pageable2.rb +2 -0
  33. data/lib/chartmogul/concerns/summary.rb +2 -0
  34. data/lib/chartmogul/config_attributes.rb +7 -1
  35. data/lib/chartmogul/configuration.rb +2 -0
  36. data/lib/chartmogul/customer.rb +2 -0
  37. data/lib/chartmogul/customer_invoices.rb +2 -0
  38. data/lib/chartmogul/data_source.rb +2 -0
  39. data/lib/chartmogul/enrichment/customer.rb +2 -0
  40. data/lib/chartmogul/errors/chartmogul_error.rb +2 -0
  41. data/lib/chartmogul/errors/configuration_error.rb +2 -0
  42. data/lib/chartmogul/errors/forbidden_error.rb +2 -0
  43. data/lib/chartmogul/errors/not_found_error.rb +2 -0
  44. data/lib/chartmogul/errors/resource_invalid_error.rb +2 -0
  45. data/lib/chartmogul/errors/schema_invalid_error.rb +2 -0
  46. data/lib/chartmogul/errors/server_error.rb +2 -0
  47. data/lib/chartmogul/errors/unauthorized_error.rb +2 -0
  48. data/lib/chartmogul/invoice.rb +2 -0
  49. data/lib/chartmogul/line_items/one_time.rb +2 -0
  50. data/lib/chartmogul/line_items/subscription.rb +2 -0
  51. data/lib/chartmogul/metrics/activity.rb +2 -0
  52. data/lib/chartmogul/metrics/all_key_metrics.rb +2 -0
  53. data/lib/chartmogul/metrics/arpa.rb +2 -0
  54. data/lib/chartmogul/metrics/arr.rb +2 -0
  55. data/lib/chartmogul/metrics/asp.rb +2 -0
  56. data/lib/chartmogul/metrics/base.rb +6 -2
  57. data/lib/chartmogul/metrics/customer_churn_rate.rb +2 -0
  58. data/lib/chartmogul/metrics/customer_count.rb +2 -0
  59. data/lib/chartmogul/metrics/ltv.rb +2 -0
  60. data/lib/chartmogul/metrics/mrr.rb +2 -0
  61. data/lib/chartmogul/metrics/mrr_churn_rate.rb +2 -0
  62. data/lib/chartmogul/metrics/subscription.rb +2 -0
  63. data/lib/chartmogul/object.rb +2 -0
  64. data/lib/chartmogul/ping.rb +2 -0
  65. data/lib/chartmogul/plan.rb +2 -0
  66. data/lib/chartmogul/plan_group.rb +39 -0
  67. data/lib/chartmogul/plan_groups/plans.rb +17 -0
  68. data/lib/chartmogul/resource_path.rb +6 -1
  69. data/lib/chartmogul/subscription.rb +2 -0
  70. data/lib/chartmogul/summary.rb +2 -0
  71. data/lib/chartmogul/transactions/payment.rb +2 -0
  72. data/lib/chartmogul/transactions/refund.rb +2 -0
  73. data/lib/chartmogul/utils/hash_snake_caser.rb +2 -0
  74. data/lib/chartmogul/utils/json_parser.rb +2 -0
  75. data/lib/chartmogul/version.rb +3 -1
  76. metadata +78 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce4f647e9c235970df04714cfaaf2e573321fbb2d0ce4cdfcb052d84dc17b68d
4
- data.tar.gz: c99cbafb09f5d900661e819db34a83372eea1020ac41ea56287b30aa98a1423c
3
+ metadata.gz: '08fe9cbc3ec7071bb35a489da5996c3a029ba6b78205fee4d824327951efa491'
4
+ data.tar.gz: cd1f5597219b881df4a19619fae2de8daa599015bb8e65829c2d5b0ed5003f5a
5
5
  SHA512:
6
- metadata.gz: e198b430a78cbcce6c6e46563bce0954a5e115aae0e5e87550621ea5cc2f42e8fc4f39226812def76a92396f2427f2a6ce3882b5abd50eac412dc4ec57ed6511
7
- data.tar.gz: 456e9d0cf65e079761109f2b62dc8ec51588ff64775d78bb84e0c82308076a94e3d109144d6966d158644baba6080017b9409aa8209b95c86f6325180a937b53
6
+ metadata.gz: ec8e502004838ba41f47c61caf5fef16315d10a90ccd1c9cd4d761382c3499225749cee94fbd582d0ad1e997f2ffaa24a9abb6b6e8751b1228cb69f88fed1992
7
+ data.tar.gz: 5e21bf5afced99d731e23566306032875c21b5292807ca5ffc873e13abd3f7187d8a4cb77c375de7840a93f2d3d8ef114c8a8f94bc8fa47a5e34689b80e9d455
@@ -1,7 +1,14 @@
1
+ os: linux
2
+ dist: bionic
3
+
1
4
  language: ruby
5
+
2
6
  rvm:
3
7
  - 2.3
4
8
  - 2.4
9
+ - 2.5
10
+ - 2.6
11
+ - 2.7
5
12
 
6
13
  before_install: gem install bundler
7
14
 
@@ -12,7 +19,7 @@ before_script:
12
19
 
13
20
  branches:
14
21
  only:
15
- - master
22
+ - main
16
23
 
17
24
  after_script:
18
25
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in chartmogul-ruby.gemspec
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 ChartMogul Ltd
3
+ Copyright (c) 2020 ChartMogul Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center">
10
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
- <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>
11
+ <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=main" alt="Travis project"></a>
12
12
  <a href="https://codeclimate.com/github/chartmogul/chartmogul-ruby/test_coverage"><img src="https://api.codeclimate.com/v1/badges/40e8bdff4d1dbf2451de/test_coverage" /></a>
13
13
  </p>
14
14
 
@@ -48,7 +48,7 @@ Or install it yourself as:
48
48
  $ gem install chartmogul-ruby
49
49
 
50
50
  ### Supported Ruby Versions
51
- This gem supports Ruby 2.3 and 2.4.
51
+ This gem supports Ruby 2.3 and above.
52
52
 
53
53
  ## Configuration
54
54
 
@@ -59,6 +59,8 @@ ChartMogul.account_token = ''
59
59
  ChartMogul.secret_key = '<Secret key goes here>'
60
60
  ```
61
61
 
62
+ Configuration is threadsafe and applied only to the current thread.
63
+
62
64
  Test your authentication:
63
65
  ```ruby
64
66
  ChartMogul::Ping.ping
@@ -115,7 +117,7 @@ The gem is available as open source under the terms of the [MIT License](http://
115
117
 
116
118
  ### The MIT License (MIT)
117
119
 
118
- *Copyright (c) 2016 ChartMogul Ltd.*
120
+ *Copyright (c) 2020 ChartMogul Ltd.*
119
121
 
120
122
  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:
121
123
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'chartmogul'
@@ -1,5 +1,8 @@
1
1
  # chartmogul-ruby Change Log
2
2
 
3
+ ## Version 1.5.0 - 20 February 2020
4
+ - Add support for plan groups API
5
+
3
6
  ## Version 1.4.0 - 20 September 2019
4
7
  - Add support for subscription sets
5
8
 
@@ -1,14 +1,14 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'chartmogul/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'chartmogul-ruby'
9
9
  spec.version = ChartMogul::VERSION
10
- spec.authors = ['Jason Langenauer']
11
- spec.email = ['jason@chartmogul.com']
10
+ spec.authors = ['Petr Kopac']
11
+ spec.email = ['petr@chartmogul.com']
12
12
 
13
13
  spec.summary = 'Chartmogul API Ruby Client'
14
14
  spec.description = 'Official Ruby client for ChartMogul\'s API'
@@ -20,13 +20,16 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_dependency 'faraday', '~> 0.15.0'
23
+ spec.add_dependency 'faraday', '~> 0.17.3'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 2.0.1'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'vcr', '~> 3.0'
29
- spec.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.2'
30
- spec.add_development_dependency 'simplecov', '~> 0.16.0'
25
+ spec.add_development_dependency 'bundler', '~> 2'
31
26
  spec.add_development_dependency 'pry', '~> 0.12.2'
27
+ spec.add_development_dependency 'rake', '~> 13.0'
28
+ spec.add_development_dependency 'rspec', '~> 3.0'
29
+ spec.add_development_dependency 'rubocop', '0.79'
30
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.38'
31
+ spec.add_development_dependency 'rubocop-thread_safety', '~> 0.3.4'
32
+ spec.add_development_dependency 'simplecov', '~> 0.17.1'
33
+ spec.add_development_dependency 'vcr', '~> 5.1'
34
+ spec.add_development_dependency 'webmock', '~> 3.8'
32
35
  end
@@ -0,0 +1,112 @@
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.17.3
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic aW52YWxpZDppbnZhbGlk
16
+ response:
17
+ status:
18
+ code: 401
19
+ message: Unauthorized
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 17 Jul 2020 08:25:06 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
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: Fri, 17 Jul 2020 08:25:06 GMT
38
+ - request:
39
+ method: get
40
+ uri: https://api.chartmogul.com/v1/ping
41
+ body:
42
+ encoding: UTF-8
43
+ string: "{}"
44
+ headers:
45
+ User-Agent:
46
+ - Faraday v0.17.3
47
+ Content-Type:
48
+ - application/json
49
+ Authorization:
50
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ server:
57
+ - nginx/1.10.1
58
+ date:
59
+ - Fri, 17 Jul 2020 08:25:11 GMT
60
+ content-type:
61
+ - application/json
62
+ transfer-encoding:
63
+ - chunked
64
+ connection:
65
+ - keep-alive
66
+ vary:
67
+ - Accept-Encoding, Accept-Encoding
68
+ status:
69
+ - 200 OK
70
+ access-control-allow-credentials:
71
+ - 'true'
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"data":"pong!"}'
75
+ http_version:
76
+ recorded_at: Fri, 17 Jul 2020 08:25:11 GMT
77
+ - request:
78
+ method: get
79
+ uri: https://api.chartmogul.com/v1/ping
80
+ body:
81
+ encoding: UTF-8
82
+ string: "{}"
83
+ headers:
84
+ User-Agent:
85
+ - Faraday v0.17.3
86
+ Content-Type:
87
+ - application/json
88
+ Authorization:
89
+ - Basic aW52YWxpZDppbnZhbGlk
90
+ response:
91
+ status:
92
+ code: 401
93
+ message: Unauthorized
94
+ headers:
95
+ server:
96
+ - nginx/1.10.1
97
+ date:
98
+ - Fri, 17 Jul 2020 08:25:11 GMT
99
+ content-type:
100
+ - application/json
101
+ transfer-encoding:
102
+ - chunked
103
+ connection:
104
+ - keep-alive
105
+ status:
106
+ - 401 Unauthorized
107
+ body:
108
+ encoding: UTF-8
109
+ string: '{"code":401,"message":"No valid API key provided","param":null}'
110
+ http_version:
111
+ recorded_at: Fri, 17 Jul 2020 08:25:11 GMT
112
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,77 @@
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.17.3
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic aW52YWxpZDppbnZhbGlk
16
+ response:
17
+ status:
18
+ code: 401
19
+ message: Unauthorized
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 17 Jul 2020 08:25:25 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
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: Fri, 17 Jul 2020 08:25:25 GMT
38
+ - request:
39
+ method: get
40
+ uri: https://api.chartmogul.com/v1/ping
41
+ body:
42
+ encoding: UTF-8
43
+ string: "{}"
44
+ headers:
45
+ User-Agent:
46
+ - Faraday v0.17.3
47
+ Content-Type:
48
+ - application/json
49
+ Authorization:
50
+ - Basic ZHVtbXktdG9rZW46ZHVtbXktdG9rZW4=
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ server:
57
+ - nginx/1.10.1
58
+ date:
59
+ - Fri, 17 Jul 2020 08:25:26 GMT
60
+ content-type:
61
+ - application/json
62
+ transfer-encoding:
63
+ - chunked
64
+ connection:
65
+ - keep-alive
66
+ vary:
67
+ - Accept-Encoding, Accept-Encoding
68
+ status:
69
+ - 200 OK
70
+ access-control-allow-credentials:
71
+ - 'true'
72
+ body:
73
+ encoding: ASCII-8BIT
74
+ string: '{"data":"pong!"}'
75
+ http_version:
76
+ recorded_at: Fri, 17 Jul 2020 08:25:26 GMT
77
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://api.chartmogul.com/v1/customers/cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"attributes":{"custom":{"company_size":"just me"},"tags":["foobar"]},"email":"curry@example.com","company":"Curry
9
+ 42","country":"IN","state":"NY","city":"Berlin","free_trial_started_at":"2020-02-02
10
+ 22:40:00 UTC"}'
11
+ headers:
12
+ User-Agent:
13
+ - Faraday v0.17.3
14
+ Content-Type:
15
+ - application/json
16
+ Authorization:
17
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Accept:
21
+ - "*/*"
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Server:
28
+ - nginx/1.10.1
29
+ Date:
30
+ - Fri, 17 Jul 2020 12:10:11 GMT
31
+ Content-Type:
32
+ - application/json
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Connection:
36
+ - keep-alive
37
+ Vary:
38
+ - Accept-Encoding
39
+ - Accept-Encoding
40
+ Status:
41
+ - 200 OK
42
+ Access-Control-Allow-Credentials:
43
+ - 'true'
44
+ body:
45
+ encoding: ASCII-8BIT
46
+ string: '{"id":33802170,"uuid":"cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1","external_id":"HngTohkREePdXBIx","name":"Currywurst","email":"curry@example.com","status":"Past
47
+ due","customer-since":"2018-12-29T00:00:00+00:00","attributes":{"custom":{"company_size":"just
48
+ me","Users":"1"},"clearbit":{},"stripe":{},"tags":["foobar"]},"data_source_uuid":"ds_b835f746-43eb-11e9-8169-9333ac374c59","data_source_uuids":["ds_b835f746-43eb-11e9-8169-9333ac374c59"],"external_ids":["HngTohkREePdXBIx"],"company":"Curry
49
+ 42","country":"IN","state":"NY","city":"Berlin","zip":null,"lead_created_at":"2018-12-15T00:00:00.000Z","free_trial_started_at":"2020-02-02T22:40:00.000Z","address":{"country":"India","state":"New
50
+ York","city":"Berlin","address_zip":null},"mrr":4900,"arr":58800,"billing-system-url":"HngTohkREePdXBIx","chartmogul-url":"https://app.chartmogul.com/#customers/33802170-Currywurst","billing-system-type":"Chargebee","currency":"USD","currency-sign":"$"}'
51
+ http_version: null
52
+ recorded_at: Fri, 17 Jul 2020 12:10:11 GMT
53
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,164 @@
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.17.3
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - nginx/1.10.1
27
+ Date:
28
+ - Thu, 23 Jul 2020 12:33:56 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 201 Created
37
+ Access-Control-Allow-Credentials:
38
+ - 'true'
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","name":"Another Data
42
+ Source","system":"Import API","created_at":"2020-07-23T12:33:56.076Z","status":"idle"}'
43
+ http_version: null
44
+ recorded_at: Thu, 23 Jul 2020 12:33:56 GMT
45
+ - request:
46
+ method: post
47
+ uri: https://api.chartmogul.com/v1/plans
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"name":"pro","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7"}'
51
+ headers:
52
+ User-Agent:
53
+ - Faraday v0.17.3
54
+ Content-Type:
55
+ - application/json
56
+ Authorization:
57
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
58
+ Accept-Encoding:
59
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
60
+ Accept:
61
+ - "*/*"
62
+ response:
63
+ status:
64
+ code: 201
65
+ message: Created
66
+ headers:
67
+ Server:
68
+ - nginx/1.10.1
69
+ Date:
70
+ - Thu, 23 Jul 2020 12:33:57 GMT
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
75
+ Connection:
76
+ - keep-alive
77
+ Status:
78
+ - 201 Created
79
+ X-Frame-Options:
80
+ - SAMEORIGIN
81
+ X-Xss-Protection:
82
+ - 1; mode=block
83
+ X-Content-Type-Options:
84
+ - nosniff
85
+ X-Download-Options:
86
+ - noopen
87
+ X-Permitted-Cross-Domain-Policies:
88
+ - none
89
+ Referrer-Policy:
90
+ - strict-origin-when-cross-origin
91
+ Etag:
92
+ - W/"ea419983710a24c40e13cc17133cfad5"
93
+ Cache-Control:
94
+ - max-age=0, private, must-revalidate
95
+ X-Request-Id:
96
+ - 8c6f92d6-c5f2-47ec-9bca-bb42bf2906bd
97
+ X-Runtime:
98
+ - '0.107610'
99
+ Strict-Transport-Security:
100
+ - max-age=15768000
101
+ body:
102
+ encoding: UTF-8
103
+ string: '{"external_id":"b37d52c0-af0e-0138-9570-42eead14b4ad","name":"pro","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","uuid":"pl_b37d52c0-af0e-0138-9570-42eead14b4ad"}'
104
+ http_version: null
105
+ recorded_at: Thu, 23 Jul 2020 12:33:57 GMT
106
+ - request:
107
+ method: patch
108
+ uri: https://api.chartmogul.com/v1/plans/pl_b37d52c0-af0e-0138-9570-42eead14b4ad
109
+ body:
110
+ encoding: UTF-8
111
+ string: '{"name":"really pro","interval_count":2}'
112
+ headers:
113
+ User-Agent:
114
+ - Faraday v0.17.3
115
+ Content-Type:
116
+ - application/json
117
+ Authorization:
118
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
119
+ Accept-Encoding:
120
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
121
+ Accept:
122
+ - "*/*"
123
+ response:
124
+ status:
125
+ code: 202
126
+ message: Accepted
127
+ headers:
128
+ Server:
129
+ - nginx/1.10.1
130
+ Date:
131
+ - Thu, 23 Jul 2020 12:33:58 GMT
132
+ Content-Type:
133
+ - application/json; charset=utf-8
134
+ Transfer-Encoding:
135
+ - chunked
136
+ Connection:
137
+ - keep-alive
138
+ Status:
139
+ - 202 Accepted
140
+ X-Frame-Options:
141
+ - SAMEORIGIN
142
+ X-Xss-Protection:
143
+ - 1; mode=block
144
+ X-Content-Type-Options:
145
+ - nosniff
146
+ X-Download-Options:
147
+ - noopen
148
+ X-Permitted-Cross-Domain-Policies:
149
+ - none
150
+ Referrer-Policy:
151
+ - strict-origin-when-cross-origin
152
+ Cache-Control:
153
+ - no-cache
154
+ X-Request-Id:
155
+ - fcc52966-8abd-442b-a9cd-e14a35988163
156
+ X-Runtime:
157
+ - '0.125362'
158
+ body:
159
+ encoding: UTF-8
160
+ string: '{"external_id":"b37d52c0-af0e-0138-9570-42eead14b4ad","name":"really
161
+ pro","interval_count":2,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","uuid":"pl_b37d52c0-af0e-0138-9570-42eead14b4ad"}'
162
+ http_version: null
163
+ recorded_at: Thu, 23 Jul 2020 12:33:58 GMT
164
+ recorded_with: VCR 5.1.0