chartmogul-ruby 4.2.0 → 4.3.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 +4 -4
- data/changelog.md +3 -0
- data/lib/chartmogul/customer.rb +12 -2
- data/lib/chartmogul/opportunity.rb +46 -0
- data/lib/chartmogul/version.rb +1 -1
- data/lib/chartmogul.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187a659678960cf3ea88e2b4e71fd04bb871616a83b6c32335edd61763f5fb27
|
4
|
+
data.tar.gz: 24560d0af68c270766d9313cdef508bd6a5b50697f12d05669bf89f95d380d8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fece8a4dbe09c3f5b245f5dce87caefb1722a61035c7c490700f3eb8265d65dbb40dbcf5a40fabf397a616f5bb9334e9e01acd2ea08f17da5ab8d5a1c217a030
|
7
|
+
data.tar.gz: d3d6771c0768bd32c4567c44d06514fa7301dde6ac6fd635ae07762cd09a95c29615fe55a1615c7bd8dac90f2384d7d43f6b5832d24ace87e8b6cccd2d88655f
|
data/changelog.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# chartmogul-ruby Change Log
|
2
2
|
|
3
|
+
## Version 4.3.0 - March 25, 2024
|
4
|
+
- Adds support for Opportunities (https://dev.chartmogul.com/reference/opportunities)
|
5
|
+
|
3
6
|
## Version 4.2.0 - February 8, 2024
|
4
7
|
- Add support for customer's `website_url` attribute
|
5
8
|
- Add support for customer's subscription `uuid` attribute
|
data/lib/chartmogul/customer.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ChartMogul
|
4
|
+
# rubocop:disable Metrics/ClassLength
|
4
5
|
class Customer < APIResource
|
5
6
|
set_resource_name 'Customer'
|
6
7
|
set_resource_path '/v1/customers'
|
7
|
-
set_immutable_keys([
|
8
|
+
set_immutable_keys(%i[attributes custom])
|
8
9
|
|
9
10
|
readonly_attr :uuid
|
10
11
|
readonly_attr :id
|
@@ -93,6 +94,14 @@ module ChartMogul
|
|
93
94
|
Note.create!(options.merge(customer_uuid: uuid))
|
94
95
|
end
|
95
96
|
|
97
|
+
def opportunities(options = {})
|
98
|
+
Opportnities.all(options.merge(customer_uuid: uuid))
|
99
|
+
end
|
100
|
+
|
101
|
+
def create_opportunity(options = {})
|
102
|
+
Opportunity.create!(options.merge(customer_uuid: uuid))
|
103
|
+
end
|
104
|
+
|
96
105
|
# Enrichment
|
97
106
|
def tags
|
98
107
|
@attributes[:tags]
|
@@ -160,7 +169,7 @@ module ChartMogul
|
|
160
169
|
class Customers < APIResource
|
161
170
|
set_resource_name 'Customers'
|
162
171
|
set_resource_path '/v1/customers'
|
163
|
-
set_immutable_keys([
|
172
|
+
set_immutable_keys(%i[attributes custom])
|
164
173
|
|
165
174
|
include Concerns::Entries
|
166
175
|
include API::Actions::Custom
|
@@ -175,4 +184,5 @@ module ChartMogul
|
|
175
184
|
custom!(:get, path.apply_with_get_params(options.merge(email: email)))
|
176
185
|
end
|
177
186
|
end
|
187
|
+
# rubocop:enable Metrics/ClassLength
|
178
188
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
|
5
|
+
module ChartMogul
|
6
|
+
class Opportunity < APIResource
|
7
|
+
set_resource_name 'Opportunity'
|
8
|
+
set_resource_path '/v1/opportunities'
|
9
|
+
set_immutable_keys([:custom])
|
10
|
+
|
11
|
+
readonly_attr :uuid
|
12
|
+
readonly_attr :created_at
|
13
|
+
readonly_attr :updated_at
|
14
|
+
|
15
|
+
writeable_attr :customer_uuid
|
16
|
+
writeable_attr :owner
|
17
|
+
writeable_attr :pipeline
|
18
|
+
writeable_attr :pipeline_stage
|
19
|
+
writeable_attr :estimated_close_date
|
20
|
+
writeable_attr :currency
|
21
|
+
writeable_attr :amount_in_cents
|
22
|
+
writeable_attr :type
|
23
|
+
writeable_attr :forecast_category
|
24
|
+
writeable_attr :win_likelihood
|
25
|
+
writeable_attr :custom
|
26
|
+
|
27
|
+
include API::Actions::Create
|
28
|
+
include API::Actions::Destroy
|
29
|
+
include API::Actions::Retrieve
|
30
|
+
include API::Actions::Update
|
31
|
+
|
32
|
+
def self.all(options = {})
|
33
|
+
Opportnities.all(options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Opportnities < APIResource
|
38
|
+
set_resource_name 'Opportunities'
|
39
|
+
set_resource_path '/v1/opportunities'
|
40
|
+
|
41
|
+
include Concerns::Entries
|
42
|
+
include Concerns::PageableWithCursor
|
43
|
+
|
44
|
+
set_entry_class Opportunity
|
45
|
+
end
|
46
|
+
end
|
data/lib/chartmogul/version.rb
CHANGED
data/lib/chartmogul.rb
CHANGED
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: 4.
|
4
|
+
version: 4.3.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: 2024-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/chartmogul/metrics/mrr_churn_rate.rb
|
251
251
|
- lib/chartmogul/note.rb
|
252
252
|
- lib/chartmogul/object.rb
|
253
|
+
- lib/chartmogul/opportunity.rb
|
253
254
|
- lib/chartmogul/ping.rb
|
254
255
|
- lib/chartmogul/plan.rb
|
255
256
|
- lib/chartmogul/plan_group.rb
|