chartmogul-ruby 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0490c891de1f7d0e0caa23a8aa9b3bb14494814cea0c77b9b20b05e534bf1e14'
4
- data.tar.gz: c141ac58cdde6ed3f2ac3f2f58bc2e3fd7961e5c903e26f836a6d7dfdf1dea90
3
+ metadata.gz: '08fe9cbc3ec7071bb35a489da5996c3a029ba6b78205fee4d824327951efa491'
4
+ data.tar.gz: cd1f5597219b881df4a19619fae2de8daa599015bb8e65829c2d5b0ed5003f5a
5
5
  SHA512:
6
- metadata.gz: 5877292fa2eb2c1b5ba3d8d2de80d5eb7b9188458e028330b8037651b4919aab6d915968fc449665bab16dbba4134938e423c43d23842ed1ce0851be6f23e5e7
7
- data.tar.gz: 1f97329b49d5077e1366826c001d02df03e14fc7cdb52f082c889d1d07258904b00b7ff4121808cc4ca477e9e1ebd7181c59f60693819f2eb12890a988eb996a
6
+ metadata.gz: ec8e502004838ba41f47c61caf5fef16315d10a90ccd1c9cd4d761382c3499225749cee94fbd582d0ad1e997f2ffaa24a9abb6b6e8751b1228cb69f88fed1992
7
+ data.tar.gz: 5e21bf5afced99d731e23566306032875c21b5292807ca5ffc873e13abd3f7187d8a4cb77c375de7840a93f2d3d8ef114c8a8f94bc8fa47a5e34689b80e9d455
@@ -19,7 +19,7 @@ before_script:
19
19
 
20
20
  branches:
21
21
  only:
22
- - master
22
+ - main
23
23
 
24
24
  after_script:
25
25
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
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
 
@@ -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
@@ -0,0 +1,297 @@
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":"Data Source #1"}'
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:34:26 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_d83adf5a-cce0-11ea-a43a-0bee9fce502d","name":"Data Source
42
+ #1","system":"Import API","created_at":"2020-07-23T12:34:26.033Z","status":"idle"}'
43
+ http_version: null
44
+ recorded_at: Thu, 23 Jul 2020 12:34:26 GMT
45
+ - request:
46
+ method: post
47
+ uri: https://api.chartmogul.com/v1/plans
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d"}'
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:34:27 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/"c69ec995cb9bab078fd6c88a194a33e0"
93
+ Cache-Control:
94
+ - max-age=0, private, must-revalidate
95
+ X-Request-Id:
96
+ - 21bb8417-4520-4b9f-aded-46d155615e98
97
+ X-Runtime:
98
+ - '0.119008'
99
+ Strict-Transport-Security:
100
+ - max-age=15768000
101
+ body:
102
+ encoding: UTF-8
103
+ string: '{"external_id":"c5723000-af0e-0138-d912-62b37fb4c770","name":"A Test
104
+ Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d","uuid":"pl_c5723000-af0e-0138-d912-62b37fb4c770"}'
105
+ http_version: null
106
+ recorded_at: Thu, 23 Jul 2020 12:34:27 GMT
107
+ - request:
108
+ method: post
109
+ uri: https://api.chartmogul.com/v1/plans
110
+ body:
111
+ encoding: UTF-8
112
+ string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d"}'
113
+ headers:
114
+ User-Agent:
115
+ - Faraday v0.17.3
116
+ Content-Type:
117
+ - application/json
118
+ Authorization:
119
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
120
+ Accept-Encoding:
121
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
122
+ Accept:
123
+ - "*/*"
124
+ response:
125
+ status:
126
+ code: 201
127
+ message: Created
128
+ headers:
129
+ Server:
130
+ - nginx/1.10.1
131
+ Date:
132
+ - Thu, 23 Jul 2020 12:34:28 GMT
133
+ Content-Type:
134
+ - application/json; charset=utf-8
135
+ Transfer-Encoding:
136
+ - chunked
137
+ Connection:
138
+ - keep-alive
139
+ Status:
140
+ - 201 Created
141
+ X-Frame-Options:
142
+ - SAMEORIGIN
143
+ X-Xss-Protection:
144
+ - 1; mode=block
145
+ X-Content-Type-Options:
146
+ - nosniff
147
+ X-Download-Options:
148
+ - noopen
149
+ X-Permitted-Cross-Domain-Policies:
150
+ - none
151
+ Referrer-Policy:
152
+ - strict-origin-when-cross-origin
153
+ Etag:
154
+ - W/"392434626ecc2ec07e9bb64179d07e58"
155
+ Cache-Control:
156
+ - max-age=0, private, must-revalidate
157
+ X-Request-Id:
158
+ - f9570c06-bfc2-4cce-b9e2-ec2ad88e2a1a
159
+ X-Runtime:
160
+ - '0.114808'
161
+ Strict-Transport-Security:
162
+ - max-age=15768000
163
+ body:
164
+ encoding: UTF-8
165
+ string: '{"external_id":"c61dc800-af0e-0138-1702-4e501129bd4a","name":"A another
166
+ Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d","uuid":"pl_c61dc800-af0e-0138-1702-4e501129bd4a"}'
167
+ http_version: null
168
+ recorded_at: Thu, 23 Jul 2020 12:34:28 GMT
169
+ - request:
170
+ method: post
171
+ uri: https://api.chartmogul.com/v1/plan_groups
172
+ body:
173
+ encoding: UTF-8
174
+ string: '{"name":"My plan group","plans":["pl_c5723000-af0e-0138-d912-62b37fb4c770","pl_c61dc800-af0e-0138-1702-4e501129bd4a"]}'
175
+ headers:
176
+ User-Agent:
177
+ - Faraday v0.17.3
178
+ Content-Type:
179
+ - application/json
180
+ Authorization:
181
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
182
+ Accept-Encoding:
183
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
184
+ Accept:
185
+ - "*/*"
186
+ response:
187
+ status:
188
+ code: 200
189
+ message: OK
190
+ headers:
191
+ Server:
192
+ - nginx/1.10.1
193
+ Date:
194
+ - Thu, 23 Jul 2020 12:34:29 GMT
195
+ Content-Type:
196
+ - application/json; charset=utf-8
197
+ Transfer-Encoding:
198
+ - chunked
199
+ Connection:
200
+ - keep-alive
201
+ Vary:
202
+ - Accept-Encoding
203
+ - Accept-Encoding
204
+ Status:
205
+ - 200 OK
206
+ X-Frame-Options:
207
+ - SAMEORIGIN
208
+ X-Xss-Protection:
209
+ - 1; mode=block
210
+ X-Content-Type-Options:
211
+ - nosniff
212
+ X-Download-Options:
213
+ - noopen
214
+ X-Permitted-Cross-Domain-Policies:
215
+ - none
216
+ Referrer-Policy:
217
+ - strict-origin-when-cross-origin
218
+ Etag:
219
+ - W/"1b33f81c506f9371501c358293e5c25e"
220
+ Cache-Control:
221
+ - max-age=0, private, must-revalidate
222
+ X-Request-Id:
223
+ - 96425a8f-ad6a-4d43-883a-28809e5e8fd2
224
+ X-Runtime:
225
+ - '0.055173'
226
+ Strict-Transport-Security:
227
+ - max-age=15768000
228
+ body:
229
+ encoding: ASCII-8BIT
230
+ string: '{"name":"My plan group","uuid":"plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc","plans_count":2}'
231
+ http_version: null
232
+ recorded_at: Thu, 23 Jul 2020 12:34:29 GMT
233
+ - request:
234
+ method: patch
235
+ uri: https://api.chartmogul.com/v1/plan_groups/plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc
236
+ body:
237
+ encoding: UTF-8
238
+ string: '{"name":"A new group name"}'
239
+ headers:
240
+ User-Agent:
241
+ - Faraday v0.17.3
242
+ Content-Type:
243
+ - application/json
244
+ Authorization:
245
+ - Basic YjNjZTUxNTNkMDYyNmQwNjE3YWQ4OWQyMzQ2OTA1OTc6OGE0YTgyOTMwYTVhMjgzOTA3MDgwNGYzMTdmNTZjYjA=
246
+ Accept-Encoding:
247
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
248
+ Accept:
249
+ - "*/*"
250
+ response:
251
+ status:
252
+ code: 200
253
+ message: OK
254
+ headers:
255
+ Server:
256
+ - nginx/1.10.1
257
+ Date:
258
+ - Thu, 23 Jul 2020 12:34:30 GMT
259
+ Content-Type:
260
+ - application/json; charset=utf-8
261
+ Transfer-Encoding:
262
+ - chunked
263
+ Connection:
264
+ - keep-alive
265
+ Vary:
266
+ - Accept-Encoding
267
+ - Accept-Encoding
268
+ Status:
269
+ - 200 OK
270
+ X-Frame-Options:
271
+ - SAMEORIGIN
272
+ X-Xss-Protection:
273
+ - 1; mode=block
274
+ X-Content-Type-Options:
275
+ - nosniff
276
+ X-Download-Options:
277
+ - noopen
278
+ X-Permitted-Cross-Domain-Policies:
279
+ - none
280
+ Referrer-Policy:
281
+ - strict-origin-when-cross-origin
282
+ Etag:
283
+ - W/"b12ead83619d709fd1285016e6daec9b"
284
+ Cache-Control:
285
+ - max-age=0, private, must-revalidate
286
+ X-Request-Id:
287
+ - 27ca96d6-4e17-4c89-b030-6fcae8131bb3
288
+ X-Runtime:
289
+ - '0.044140'
290
+ Strict-Transport-Security:
291
+ - max-age=15768000
292
+ body:
293
+ encoding: ASCII-8BIT
294
+ string: '{"name":"A new group name","uuid":"plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc","plans_count":2}'
295
+ http_version: null
296
+ recorded_at: Thu, 23 Jul 2020 12:34:30 GMT
297
+ recorded_with: VCR 5.1.0
@@ -4,6 +4,10 @@ module ChartMogul
4
4
  module API
5
5
  module Actions
6
6
  module Update
7
+ def self.included(base)
8
+ base.extend ClassMethods
9
+ end
10
+
7
11
  def update!
8
12
  resp = handling_errors do
9
13
  connection.patch("#{resource_path.apply(instance_attributes)}/#{uuid}") do |req|
@@ -15,6 +19,22 @@ module ChartMogul
15
19
 
16
20
  assign_all_attributes(json)
17
21
  end
22
+
23
+ module ClassMethods
24
+ def update!(uuid, attributes = {})
25
+ resource = new(attributes)
26
+
27
+ resp = handling_errors do
28
+ connection.patch("#{resource_path.apply(attributes)}/#{uuid}") do |req|
29
+ req.headers['Content-Type'] = 'application/json'
30
+ req.body = JSON.dump(resource.serialize_for_write)
31
+ end
32
+ end
33
+ json = ChartMogul::Utils::JSONParser.parse(resp.body)
34
+
35
+ new_from_json(json)
36
+ end
37
+ end
18
38
  end
19
39
  end
20
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChartMogul
4
- VERSION = '1.6.1'
4
+ VERSION = '1.6.2'
5
5
  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: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Kopac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-17 00:00:00.000000000 Z
11
+ date: 2020-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -200,6 +200,7 @@ files:
200
200
  - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml
201
201
  - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml
202
202
  - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml
203
+ - fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml
203
204
  - fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml
204
205
  - fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml
205
206
  - fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml
@@ -242,11 +243,13 @@ files:
242
243
  - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml
243
244
  - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml
244
245
  - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml
246
+ - fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml
245
247
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml
246
248
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml
247
249
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml
248
250
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml
249
251
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml
252
+ - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml
250
253
  - fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml
251
254
  - fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml
252
255
  - fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml