chartmogul-ruby 1.1.5 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +10 -10
  3. data/.rspec +2 -2
  4. data/.travis.yml +9 -4
  5. data/Gemfile +4 -4
  6. data/LICENSE.txt +21 -21
  7. data/README.md +111 -111
  8. data/Rakefile +6 -6
  9. data/bin/console +14 -14
  10. data/bin/setup +9 -9
  11. data/changelog.md +27 -27
  12. data/chartmogul-ruby.gemspec +30 -30
  13. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml +80 -80
  14. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml +79 -79
  15. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml +43 -43
  16. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml +50 -50
  17. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml +244 -244
  18. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml +185 -185
  19. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml +38 -38
  20. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml +38 -38
  21. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml +86 -86
  22. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml +80 -80
  23. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml +80 -80
  24. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +47 -47
  25. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +42 -42
  26. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +43 -43
  27. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml +82 -82
  28. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml +139 -139
  29. data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml +102 -102
  30. data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml +101 -101
  31. data/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +298 -298
  32. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -189
  33. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -46
  34. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -48
  35. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml +101 -101
  36. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml +37 -37
  37. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml +37 -37
  38. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml +42 -42
  39. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml +50 -50
  40. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml +46 -46
  41. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  42. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  43. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  44. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  45. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  46. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  47. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml +41 -41
  48. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +41 -41
  49. data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +42 -42
  50. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  51. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  52. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  53. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  54. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  55. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  56. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml +42 -42
  57. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +42 -42
  58. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  59. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  60. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml +40 -40
  61. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml +40 -40
  62. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml +38 -38
  63. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml +38 -38
  64. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml +51 -51
  65. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml +152 -152
  66. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml +198 -198
  67. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml +151 -151
  68. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml +198 -198
  69. data/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +340 -340
  70. data/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml +101 -101
  71. data/fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml +243 -243
  72. data/lib/chartmogul.rb +81 -81
  73. data/lib/chartmogul/api/actions/all.rb +23 -23
  74. data/lib/chartmogul/api/actions/create.rb +39 -39
  75. data/lib/chartmogul/api/actions/custom.rb +37 -37
  76. data/lib/chartmogul/api/actions/destroy.rb +27 -27
  77. data/lib/chartmogul/api/actions/retrieve.rb +23 -23
  78. data/lib/chartmogul/api/actions/update.rb +19 -19
  79. data/lib/chartmogul/api_resource.rb +68 -68
  80. data/lib/chartmogul/concerns/entries.rb +37 -37
  81. data/lib/chartmogul/concerns/pageable.rb +13 -13
  82. data/lib/chartmogul/concerns/pageable2.rb +12 -12
  83. data/lib/chartmogul/concerns/summary.rb +19 -19
  84. data/lib/chartmogul/config_attributes.rb +15 -15
  85. data/lib/chartmogul/configuration.rb +6 -6
  86. data/lib/chartmogul/customer.rb +156 -156
  87. data/lib/chartmogul/customer_invoices.rb +44 -44
  88. data/lib/chartmogul/data_source.rb +34 -34
  89. data/lib/chartmogul/enrichment/customer.rb +140 -140
  90. data/lib/chartmogul/errors/chartmogul_error.rb +19 -19
  91. data/lib/chartmogul/errors/configuration_error.rb +4 -4
  92. data/lib/chartmogul/errors/forbidden_error.rb +4 -4
  93. data/lib/chartmogul/errors/not_found_error.rb +4 -4
  94. data/lib/chartmogul/errors/resource_invalid_error.rb +4 -4
  95. data/lib/chartmogul/errors/schema_invalid_error.rb +4 -4
  96. data/lib/chartmogul/errors/unauthorized_error.rb +4 -4
  97. data/lib/chartmogul/invoice.rb +86 -86
  98. data/lib/chartmogul/line_items/one_time.rb +24 -23
  99. data/lib/chartmogul/line_items/subscription.rb +30 -29
  100. data/lib/chartmogul/metrics/activity.rb +33 -33
  101. data/lib/chartmogul/metrics/all_key_metrics.rb +24 -24
  102. data/lib/chartmogul/metrics/arpa.rb +18 -18
  103. data/lib/chartmogul/metrics/arr.rb +18 -18
  104. data/lib/chartmogul/metrics/asp.rb +18 -18
  105. data/lib/chartmogul/metrics/base.rb +54 -54
  106. data/lib/chartmogul/metrics/customer_churn_rate.rb +18 -18
  107. data/lib/chartmogul/metrics/customer_count.rb +18 -18
  108. data/lib/chartmogul/metrics/ltv.rb +18 -18
  109. data/lib/chartmogul/metrics/mrr.rb +26 -26
  110. data/lib/chartmogul/metrics/mrr_churn_rate.rb +18 -18
  111. data/lib/chartmogul/metrics/subscription.rb +37 -37
  112. data/lib/chartmogul/object.rb +119 -119
  113. data/lib/chartmogul/ping.rb +14 -14
  114. data/lib/chartmogul/plan.rb +37 -37
  115. data/lib/chartmogul/resource_path.rb +42 -42
  116. data/lib/chartmogul/subscription.rb +47 -47
  117. data/lib/chartmogul/summary.rb +7 -7
  118. data/lib/chartmogul/transactions/payment.rb +24 -24
  119. data/lib/chartmogul/transactions/refund.rb +24 -24
  120. data/lib/chartmogul/utils/hash_snake_caser.rb +49 -49
  121. data/lib/chartmogul/utils/json_parser.rb +10 -10
  122. data/lib/chartmogul/version.rb +3 -3
  123. metadata +3 -4
@@ -1,50 +1,50 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.chartmogul.com/v1/customers
6
- body:
7
- encoding: UTF-8
8
- string: '{"data_source_uuid":null,"external_id":null,"name":null,"email":null,"company":null,"country":null,"state":null,"city":null,"zip":null}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.9.1
12
- Content-Type:
13
- - application/json
14
- Authorization:
15
- - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
16
- response:
17
- status:
18
- code: 422
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.9.10
23
- date:
24
- - Mon, 06 Jun 2016 15:26:39 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
- - db053e91-1f33-45fe-a8f2-d06c507e8066
41
- x-runtime:
42
- - '0.033493'
43
- body:
44
- encoding: UTF-8
45
- string: '{"errors":{"external_id":"A unique external ID is required for each
46
- customer.","name":"A name is required for each customer.","data_source_uuid":"A
47
- valid data source UUID is required for each customer."}}'
48
- http_version:
49
- recorded_at: Mon, 06 Jun 2016 15:26:39 GMT
50
- recorded_with: VCR 3.0.3
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.chartmogul.com/v1/customers
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data_source_uuid":null,"external_id":null,"name":null,"email":null,"company":null,"country":null,"state":null,"city":null,"zip":null}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
16
+ response:
17
+ status:
18
+ code: 422
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Mon, 06 Jun 2016 15:26:39 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
+ - db053e91-1f33-45fe-a8f2-d06c507e8066
41
+ x-runtime:
42
+ - '0.033493'
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"errors":{"external_id":"A unique external ID is required for each
46
+ customer.","name":"A name is required for each customer.","data_source_uuid":"A
47
+ valid data source UUID is required for each customer."}}'
48
+ http_version:
49
+ recorded_at: Mon, 06 Jun 2016 15:26:39 GMT
50
+ recorded_with: VCR 3.0.3
@@ -1,244 +1,244 @@
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":"Customer Test Data Source"}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.9.2
12
- Content-Type:
13
- - application/json
14
- Authorization:
15
- - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
16
- response:
17
- status:
18
- code: 201
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.10.1
23
- date:
24
- - Tue, 08 Nov 2016 08:57:33 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/"bcfee5f9180970835929930b05411ff4"
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- x-request-id:
42
- - 9505cefe-9a7a-46af-a173-7a686cf46800
43
- x-runtime:
44
- - '0.461858'
45
- strict-transport-security:
46
- - max-age=15768000
47
- body:
48
- encoding: UTF-8
49
- string: '{"uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa","name":"Customer
50
- Test Data Source","created_at":"2016-11-08T08:57:33.304Z","status":"never_imported"}'
51
- http_version:
52
- recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
53
- - request:
54
- method: post
55
- uri: https://api.chartmogul.com/v1/customers
56
- body:
57
- encoding: UTF-8
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
59
- 23:55:00 UTC","free_trial_started_at":"2016-10-12 11:12:00 UTC"}'
60
- headers:
61
- User-Agent:
62
- - Faraday v0.9.2
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.10.1
74
- date:
75
- - Tue, 08 Nov 2016 08:57:33 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/"edb1e5e3324d47803eccb229a21363df"
90
- cache-control:
91
- - max-age=0, private, must-revalidate
92
- x-request-id:
93
- - bf049e2c-b057-4d90-85bf-f90c9ca98b31
94
- x-runtime:
95
- - '0.158973'
96
- strict-transport-security:
97
- - max-age=15768000
98
- body:
99
- encoding: UTF-8
100
- string: '{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
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:
103
- recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
104
- - request:
105
- method: get
106
- uri: https://api.chartmogul.com/v1/customers
107
- body:
108
- encoding: US-ASCII
109
- string: ''
110
- headers:
111
- User-Agent:
112
- - Faraday v0.9.2
113
- Content-Type:
114
- - application/json
115
- Authorization:
116
- - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
117
- response:
118
- status:
119
- code: 200
120
- message:
121
- headers:
122
- server:
123
- - nginx/1.10.1
124
- date:
125
- - Tue, 08 Nov 2016 08:57:34 GMT
126
- content-type:
127
- - application/json; charset=utf-8
128
- transfer-encoding:
129
- - chunked
130
- connection:
131
- - close
132
- x-frame-options:
133
- - SAMEORIGIN
134
- x-xss-protection:
135
- - 1; mode=block
136
- x-content-type-options:
137
- - nosniff
138
- etag:
139
- - W/"eb861872d3bd01a055485e96ccf38898"
140
- cache-control:
141
- - max-age=0, private, must-revalidate
142
- x-request-id:
143
- - 32f87d7c-f944-405d-a87c-2195f175940a
144
- x-runtime:
145
- - '0.022802'
146
- strict-transport-security:
147
- - max-age=15768000
148
- body:
149
- encoding: UTF-8
150
- string: '{"entries":[{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
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,"has_more":false,"per_page":50,"page":1}'
152
- http_version:
153
- recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
154
- - request:
155
- method: delete
156
- uri: https://api.chartmogul.com/v1/customers/cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16
157
- body:
158
- encoding: US-ASCII
159
- string: ''
160
- headers:
161
- User-Agent:
162
- - Faraday v0.9.2
163
- Authorization:
164
- - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
165
- response:
166
- status:
167
- code: 204
168
- message:
169
- headers:
170
- server:
171
- - nginx/1.10.1
172
- date:
173
- - Tue, 08 Nov 2016 08:57:34 GMT
174
- connection:
175
- - close
176
- x-frame-options:
177
- - SAMEORIGIN
178
- x-xss-protection:
179
- - 1; mode=block
180
- x-content-type-options:
181
- - nosniff
182
- cache-control:
183
- - no-cache
184
- x-request-id:
185
- - f163488f-bbea-4937-897b-ee08b69a4560
186
- x-runtime:
187
- - '0.015696'
188
- strict-transport-security:
189
- - max-age=15768000
190
- body:
191
- encoding: UTF-8
192
- string: ''
193
- http_version:
194
- recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
195
- - request:
196
- method: get
197
- uri: https://api.chartmogul.com/v1/customers
198
- body:
199
- encoding: US-ASCII
200
- string: ''
201
- headers:
202
- User-Agent:
203
- - Faraday v0.9.2
204
- Content-Type:
205
- - application/json
206
- Authorization:
207
- - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
208
- response:
209
- status:
210
- code: 200
211
- message:
212
- headers:
213
- server:
214
- - nginx/1.10.1
215
- date:
216
- - Tue, 08 Nov 2016 08:57:34 GMT
217
- content-type:
218
- - application/json; charset=utf-8
219
- transfer-encoding:
220
- - chunked
221
- connection:
222
- - close
223
- x-frame-options:
224
- - SAMEORIGIN
225
- x-xss-protection:
226
- - 1; mode=block
227
- x-content-type-options:
228
- - nosniff
229
- etag:
230
- - W/"82f80d77a5a88d6de206bb1feeb897cc"
231
- cache-control:
232
- - max-age=0, private, must-revalidate
233
- x-request-id:
234
- - 770d6629-03d8-4f55-8bec-dde047828e7e
235
- x-runtime:
236
- - '0.019712'
237
- strict-transport-security:
238
- - max-age=15768000
239
- body:
240
- encoding: UTF-8
241
- string: '{"customers":[],"current_page":1,"total_pages":0,"has_more":false,"per_page":50,"page":1}'
242
- http_version:
243
- recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
244
- recorded_with: VCR 3.0.3
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":"Customer Test Data Source"}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
16
+ response:
17
+ status:
18
+ code: 201
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Tue, 08 Nov 2016 08:57:33 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/"bcfee5f9180970835929930b05411ff4"
39
+ cache-control:
40
+ - max-age=0, private, must-revalidate
41
+ x-request-id:
42
+ - 9505cefe-9a7a-46af-a173-7a686cf46800
43
+ x-runtime:
44
+ - '0.461858'
45
+ strict-transport-security:
46
+ - max-age=15768000
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"uuid":"ds_632433ee-a591-11e6-aa29-ff9ccc9a74aa","name":"Customer
50
+ Test Data Source","created_at":"2016-11-08T08:57:33.304Z","status":"never_imported"}'
51
+ http_version:
52
+ recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://api.chartmogul.com/v1/customers
56
+ body:
57
+ encoding: UTF-8
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
59
+ 23:55:00 UTC","free_trial_started_at":"2016-10-12 11:12:00 UTC"}'
60
+ headers:
61
+ User-Agent:
62
+ - Faraday v0.9.2
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.10.1
74
+ date:
75
+ - Tue, 08 Nov 2016 08:57:33 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/"edb1e5e3324d47803eccb229a21363df"
90
+ cache-control:
91
+ - max-age=0, private, must-revalidate
92
+ x-request-id:
93
+ - bf049e2c-b057-4d90-85bf-f90c9ca98b31
94
+ x-runtime:
95
+ - '0.158973'
96
+ strict-transport-security:
97
+ - max-age=15768000
98
+ body:
99
+ encoding: UTF-8
100
+ string: '{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
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:
103
+ recorded_at: Tue, 08 Nov 2016 08:57:33 GMT
104
+ - request:
105
+ method: get
106
+ uri: https://api.chartmogul.com/v1/customers
107
+ body:
108
+ encoding: US-ASCII
109
+ string: ''
110
+ headers:
111
+ User-Agent:
112
+ - Faraday v0.9.2
113
+ Content-Type:
114
+ - application/json
115
+ Authorization:
116
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
117
+ response:
118
+ status:
119
+ code: 200
120
+ message:
121
+ headers:
122
+ server:
123
+ - nginx/1.10.1
124
+ date:
125
+ - Tue, 08 Nov 2016 08:57:34 GMT
126
+ content-type:
127
+ - application/json; charset=utf-8
128
+ transfer-encoding:
129
+ - chunked
130
+ connection:
131
+ - close
132
+ x-frame-options:
133
+ - SAMEORIGIN
134
+ x-xss-protection:
135
+ - 1; mode=block
136
+ x-content-type-options:
137
+ - nosniff
138
+ etag:
139
+ - W/"eb861872d3bd01a055485e96ccf38898"
140
+ cache-control:
141
+ - max-age=0, private, must-revalidate
142
+ x-request-id:
143
+ - 32f87d7c-f944-405d-a87c-2195f175940a
144
+ x-runtime:
145
+ - '0.022802'
146
+ strict-transport-security:
147
+ - max-age=15768000
148
+ body:
149
+ encoding: UTF-8
150
+ string: '{"entries":[{"uuid":"cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16","external_id":"X1234","name":"Test
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,"has_more":false,"per_page":50,"page":1}'
152
+ http_version:
153
+ recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
154
+ - request:
155
+ method: delete
156
+ uri: https://api.chartmogul.com/v1/customers/cus_709bf73d-dc7c-4fb3-825d-a32c7fe5be16
157
+ body:
158
+ encoding: US-ASCII
159
+ string: ''
160
+ headers:
161
+ User-Agent:
162
+ - Faraday v0.9.2
163
+ Authorization:
164
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
165
+ response:
166
+ status:
167
+ code: 204
168
+ message:
169
+ headers:
170
+ server:
171
+ - nginx/1.10.1
172
+ date:
173
+ - Tue, 08 Nov 2016 08:57:34 GMT
174
+ connection:
175
+ - close
176
+ x-frame-options:
177
+ - SAMEORIGIN
178
+ x-xss-protection:
179
+ - 1; mode=block
180
+ x-content-type-options:
181
+ - nosniff
182
+ cache-control:
183
+ - no-cache
184
+ x-request-id:
185
+ - f163488f-bbea-4937-897b-ee08b69a4560
186
+ x-runtime:
187
+ - '0.015696'
188
+ strict-transport-security:
189
+ - max-age=15768000
190
+ body:
191
+ encoding: UTF-8
192
+ string: ''
193
+ http_version:
194
+ recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
195
+ - request:
196
+ method: get
197
+ uri: https://api.chartmogul.com/v1/customers
198
+ body:
199
+ encoding: US-ASCII
200
+ string: ''
201
+ headers:
202
+ User-Agent:
203
+ - Faraday v0.9.2
204
+ Content-Type:
205
+ - application/json
206
+ Authorization:
207
+ - Basic ODE2MjZkMWFiMzU5NTIwMzY5MjhjNjJjYmJiNDMyN2M6ODY3MDRmMDdkYzQwZmYzYjYyYzRjY2E5OTYxMjk2MzY=
208
+ response:
209
+ status:
210
+ code: 200
211
+ message:
212
+ headers:
213
+ server:
214
+ - nginx/1.10.1
215
+ date:
216
+ - Tue, 08 Nov 2016 08:57:34 GMT
217
+ content-type:
218
+ - application/json; charset=utf-8
219
+ transfer-encoding:
220
+ - chunked
221
+ connection:
222
+ - close
223
+ x-frame-options:
224
+ - SAMEORIGIN
225
+ x-xss-protection:
226
+ - 1; mode=block
227
+ x-content-type-options:
228
+ - nosniff
229
+ etag:
230
+ - W/"82f80d77a5a88d6de206bb1feeb897cc"
231
+ cache-control:
232
+ - max-age=0, private, must-revalidate
233
+ x-request-id:
234
+ - 770d6629-03d8-4f55-8bec-dde047828e7e
235
+ x-runtime:
236
+ - '0.019712'
237
+ strict-transport-security:
238
+ - max-age=15768000
239
+ body:
240
+ encoding: UTF-8
241
+ string: '{"customers":[],"current_page":1,"total_pages":0,"has_more":false,"per_page":50,"page":1}'
242
+ http_version:
243
+ recorded_at: Tue, 08 Nov 2016 08:57:34 GMT
244
+ recorded_with: VCR 3.0.3