chartmogul-ruby 2.0.0 → 2.1.0

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: 86b36660d2c3b0a96c64043db0972df8d4e175a0c5aa16207205af589b0c1519
4
- data.tar.gz: d94893728579c81658b93a79dad253806bb98021f6ccc5eb124d81452c2f621b
3
+ metadata.gz: 33e208966c719bffc9d8d9d181e4644d65b46ec358874ecf2a81cfc1e8e048e6
4
+ data.tar.gz: 6cfac8ebad05c2f72de739dbf6658a08c19a49390690fb5cf606b8f7e30b7c92
5
5
  SHA512:
6
- metadata.gz: 34f57b3c3eda27f75c710c2d38c1b95fe66caa726e401d700a42dfbd4c75f54c4bbf7c9fd31768e8478d59663518a340d42e34592890ad088323a0e0a031ad84
7
- data.tar.gz: e9e2bcc3fa435cfe8f924673db791ffda6c5dc3da740eee2b9b4118dc025ce2c3fb10ceff8d2383db1acb255a039f9ecbbeda1dc457cae8b6329d6454107386f
6
+ metadata.gz: b3a003808b751464816eae04ce90cfb84d131e3dca1542f2038399a6ed61e5cc1ab235342a563bce20ccfdfd66d2dd7a1f75d4e8dd52406c79acbf733ed5cc04
7
+ data.tar.gz: 9a1dbeb5328f677ffae281290c0fc278b82fdb86dfe05f3c562f8c509608b42fe717bd040361224e9eb1a82a01205674c49192d08945e2101521bbd58ad91dae
data/.rspec CHANGED
File without changes
data/changelog.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # chartmogul-ruby Change Log
2
2
 
3
+ ## Version 2.1.0 - 9 July 2021
4
+ - Adds ChartMogul::Metrics::ActivitiesExport class to support async activities export endpoint
5
+
3
6
  ## Version 2.0.0 - 25 June 2021
4
7
  - Moves customer scoped Metrics::Activities and Metrics::Subscriptions under Metrics::Customers namespace
5
- - Adds unscoped activites API endpoint
8
+ - Adds unscoped activities API endpoint
6
9
 
7
10
  ## Version 1.7.2 - 16 March 2021
8
11
  - Fix bug preventing instantiating attributes on ChartMogul::Customers objects
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/activities_export/44037b8f-4a89-4fc6-8114-2288c71a9518
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.0.1
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 09 Jul 2021 14:06:07 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
31
+ vary:
32
+ - Accept-Encoding, Accept-Encoding
33
+ status:
34
+ - 200 OK
35
+ access-control-allow-credentials:
36
+ - 'true'
37
+ body:
38
+ encoding: ASCII-8BIT
39
+ string: '{"id":"44037b8f-4a89-4fc6-8114-2288c71a9518","status":"succeeded","file_url":"https://chartmogul-customer-export.s3.eu-west-1.amazonaws.com/activities-acme-corp-062ea48c-5d74-46dd-bd60-23206cdc241a.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=123%2Feu-west-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20210709T135547Z\u0026X-Amz-Expires=604800\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=abc","params":{"kind":"activities","params":{"end_date":"2020-12-31
40
+ 00:00:00 +0000","start_date":"2020-01-01 00:00:00 +0000","activity_type":"new_biz"}},"expires_at":"2021-07-16T13:55:47+00:00","created_at":"2021-07-09T13:55:44+00:00"}'
41
+ http_version:
42
+ recorded_at: Fri, 09 Jul 2021 14:06:07 GMT
43
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,83 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.chartmogul.com/v1/activities_export
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"start-date":"2020-01-01T00:00:00Z","end-date":"2020-12-31T00:00:00Z","type":"new_biz"}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.0.1
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ server:
22
+ - nginx/1.10.1
23
+ date:
24
+ - Fri, 09 Jul 2021 14:37:32 GMT
25
+ content-type:
26
+ - application/json
27
+ transfer-encoding:
28
+ - chunked
29
+ connection:
30
+ - keep-alive
31
+ vary:
32
+ - Accept-Encoding, Accept-Encoding
33
+ status:
34
+ - 200 OK
35
+ access-control-allow-credentials:
36
+ - 'true'
37
+ body:
38
+ encoding: ASCII-8BIT
39
+ string: '{"id":"17042239-3674-4a61-b838-b6b307f28506","status":"pending","file_url":null,"params":{"kind":"activities","params":{"activity_type":"new_biz","start_date":"2020-01-01
40
+ 00:00:00 +0000","end_date":"2020-12-31 00:00:00 +0000"}},"expires_at":null,"created_at":"2021-07-09T14:37:32+00:00"}'
41
+ http_version:
42
+ recorded_at: Fri, 09 Jul 2021 14:37:32 GMT
43
+ - request:
44
+ method: get
45
+ uri: https://api.chartmogul.com/v1/activities_export/17042239-3674-4a61-b838-b6b307f28506
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ''
49
+ headers:
50
+ User-Agent:
51
+ - Faraday v1.0.1
52
+ Content-Type:
53
+ - application/json
54
+ Authorization:
55
+ - Basic hidden
56
+ response:
57
+ status:
58
+ code: 200
59
+ message: OK
60
+ headers:
61
+ server:
62
+ - nginx/1.10.1
63
+ date:
64
+ - Fri, 09 Jul 2021 14:38:10 GMT
65
+ content-type:
66
+ - application/json
67
+ transfer-encoding:
68
+ - chunked
69
+ connection:
70
+ - keep-alive
71
+ vary:
72
+ - Accept-Encoding, Accept-Encoding
73
+ status:
74
+ - 200 OK
75
+ access-control-allow-credentials:
76
+ - 'true'
77
+ body:
78
+ encoding: ASCII-8BIT
79
+ string: '{"id":"17042239-3674-4a61-b838-b6b307f28506","status":"succeeded","file_url":"https://chartmogul-customer-export.s3.eu-west-1.amazonaws.com/activities-acme-corp-062ea48c-5d74-46dd-bd60-23206cdc241a.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=123%2Feu-west-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20210709T135547Z\u0026X-Amz-Expires=604800\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=abc","params":{"kind":"activities","params":{"end_date":"2020-12-31
80
+ 00:00:00 +0000","start_date":"2020-01-01 00:00:00 +0000","activity_type":"new_biz"}},"expires_at":"2021-07-16T14:37:43+00:00","created_at":"2021-07-09T14:37:32+00:00"}'
81
+ http_version:
82
+ recorded_at: Fri, 09 Jul 2021 14:38:10 GMT
83
+ recorded_with: VCR 5.1.0
data/lib/chartmogul.rb CHANGED
@@ -70,6 +70,7 @@ require 'chartmogul/metrics/base'
70
70
  require 'chartmogul/metrics/customers/activity'
71
71
  require 'chartmogul/metrics/customers/subscription'
72
72
  require 'chartmogul/metrics/activity'
73
+ require 'chartmogul/metrics/activities_export'
73
74
 
74
75
  require 'chartmogul/enrichment/customer'
75
76
 
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ChartMogul
4
+ module Metrics
5
+ class ActivitiesExport < APIResource
6
+ set_resource_name 'ActivitiesExport'
7
+ set_resource_path '/v1/activities_export'
8
+
9
+ readonly_attr :id
10
+ readonly_attr :status
11
+ readonly_attr :file_url
12
+ readonly_attr :params
13
+ readonly_attr :expires_at
14
+ readonly_attr :created_at
15
+
16
+ writeable_attr :start_date
17
+ writeable_attr :end_date
18
+ writeable_attr :type
19
+
20
+ include API::Actions::Retrieve
21
+ include API::Actions::Create
22
+
23
+ def serialize_for_write
24
+ super.tap do |attributes|
25
+ attributes.clone.each do |k, v|
26
+ attributes[preprocess_attributes(k)] = attributes.delete(k)
27
+ end
28
+ end
29
+ end
30
+
31
+ def preprocess_attributes(attribute)
32
+ return attribute unless %i[start_date end_date].include?(attribute)
33
+
34
+ attribute.to_s.tr('_', '-')
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChartMogul
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
data/pre-commit.example CHANGED
File without changes
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: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Kopac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -222,6 +222,8 @@ files:
222
222
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml
223
223
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
224
224
  - fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml
225
+ - fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml
226
+ - fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml
225
227
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Activity.yml
226
228
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml
227
229
  - fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml
@@ -297,6 +299,7 @@ files:
297
299
  - lib/chartmogul/invoice.rb
298
300
  - lib/chartmogul/line_items/one_time.rb
299
301
  - lib/chartmogul/line_items/subscription.rb
302
+ - lib/chartmogul/metrics/activities_export.rb
300
303
  - lib/chartmogul/metrics/activity.rb
301
304
  - lib/chartmogul/metrics/all_key_metrics.rb
302
305
  - lib/chartmogul/metrics/arpa.rb