chartmogul-ruby 1.4.1 → 1.5.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/chartmogul-ruby.gemspec +1 -1
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml +50 -0
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml +293 -0
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml +251 -0
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml +357 -0
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml +304 -0
- data/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml +411 -0
- 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
- data/lib/chartmogul.rb +2 -0
- data/lib/chartmogul/plan_group.rb +37 -0
- data/lib/chartmogul/plan_groups/plans.rb +15 -0
- data/lib/chartmogul/version.rb +1 -1
- metadata +13 -4
data/lib/chartmogul.rb
CHANGED
@@ -49,6 +49,8 @@ require 'chartmogul/customer'
|
|
49
49
|
require 'chartmogul/data_source'
|
50
50
|
require 'chartmogul/ping'
|
51
51
|
require 'chartmogul/plan'
|
52
|
+
require 'chartmogul/plan_group'
|
53
|
+
require 'chartmogul/plan_groups/plans'
|
52
54
|
|
53
55
|
require 'chartmogul/metrics/arpa'
|
54
56
|
require 'chartmogul/metrics/arr'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module ChartMogul
|
2
|
+
class PlanGroup < APIResource
|
3
|
+
set_resource_name 'PlanGroup'
|
4
|
+
set_resource_path '/v1/plan_groups'
|
5
|
+
|
6
|
+
readonly_attr :uuid
|
7
|
+
readonly_attr :plans_count
|
8
|
+
|
9
|
+
writeable_attr :name
|
10
|
+
writeable_attr :plans, default: []
|
11
|
+
|
12
|
+
include API::Actions::Create
|
13
|
+
include API::Actions::Destroy
|
14
|
+
include API::Actions::Retrieve
|
15
|
+
include API::Actions::Update
|
16
|
+
|
17
|
+
def self.all(options = {})
|
18
|
+
PlanGroups.all(options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def serialize_plans
|
22
|
+
plans.map(&:uuid)
|
23
|
+
end
|
24
|
+
|
25
|
+
class PlanGroups < APIResource
|
26
|
+
set_resource_name 'PlanGroups'
|
27
|
+
set_resource_path '/v1/plan_groups'
|
28
|
+
|
29
|
+
set_resource_root_key :plan_groups
|
30
|
+
|
31
|
+
include Concerns::Entries
|
32
|
+
include Concerns::Pageable2
|
33
|
+
|
34
|
+
set_entry_class PlanGroup
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ChartMogul
|
2
|
+
module PlanGroups
|
3
|
+
class Plans < APIResource
|
4
|
+
set_resource_name 'Plans'
|
5
|
+
set_resource_path '/v1/plan_groups/:plan_group_uuid/plans'
|
6
|
+
|
7
|
+
set_resource_root_key :plans
|
8
|
+
|
9
|
+
include Concerns::Entries
|
10
|
+
include Concerns::Pageable2
|
11
|
+
|
12
|
+
set_entry_class Plan
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/chartmogul/version.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: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Langenauer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2
|
33
|
+
version: '2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +204,13 @@ files:
|
|
204
204
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml
|
205
205
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml
|
206
206
|
- fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml
|
207
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml
|
208
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml
|
209
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml
|
210
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml
|
211
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml
|
212
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml
|
213
|
+
- fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml
|
207
214
|
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml
|
208
215
|
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
|
209
216
|
- fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml
|
@@ -256,6 +263,8 @@ files:
|
|
256
263
|
- lib/chartmogul/object.rb
|
257
264
|
- lib/chartmogul/ping.rb
|
258
265
|
- lib/chartmogul/plan.rb
|
266
|
+
- lib/chartmogul/plan_group.rb
|
267
|
+
- lib/chartmogul/plan_groups/plans.rb
|
259
268
|
- lib/chartmogul/resource_path.rb
|
260
269
|
- lib/chartmogul/subscription.rb
|
261
270
|
- lib/chartmogul/summary.rb
|