supercast 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5374e2e269a13c4309feb2b26f965e041cb26bc4cc1d4bb2e038c647b0ce0e6
4
- data.tar.gz: 20cf96eb8b566636aff03f9a279799e575ec94f5418d9542f4f11613c163f8ab
3
+ metadata.gz: 25cab022899835f7273b4926c69ed6cd9001e33971c01b117cc0f2072b326ac6
4
+ data.tar.gz: ad3076662d959636b151f999a17c40117c42cbd531a067f4e716eb53566ad09c
5
5
  SHA512:
6
- metadata.gz: 493cc4eb2d7275763e154eca5d322fb6a5a1d2feafcdcbb436c1a6eb1359d5cb1040edcbfd01adbed818a0fc3861c8c00c8a45758b05cd26609f149f613fb80a
7
- data.tar.gz: 8c00d78d01938601b4b379503b312dc9f504ae5624444f317852fb1b9072517a2976c94edb2a0948dba468f171e96f051a6ef9c1dc152460d71d2d0abc99ca41
6
+ metadata.gz: 82c86bbdd85ee90087d878ab158f4465286d5447d342d333c2f446a769d9a43b353b69c329d3abde7ddbbec882d628b6a3ae5b17d06038868391e15386288f0c
7
+ data.tar.gz: 84fe673399d1c5b5f82810407b7bf2c7a196303c6cec5cfd3c9b5632cb99dd51d6041f48cc5a495b93b3da095416b9e2fb3bc62526c5e1c03a6cf79c83e3b138
data/lib/supercast.rb CHANGED
@@ -21,6 +21,7 @@ require_relative 'supercast/operations/destroy'
21
21
  require_relative 'supercast/operations/list'
22
22
  require_relative 'supercast/operations/request'
23
23
  require_relative 'supercast/operations/save'
24
+ require_relative 'supercast/operations/feeds'
24
25
 
25
26
  # API resource support classes
26
27
  require_relative 'supercast/errors'
@@ -14,7 +14,8 @@ module Supercast
14
14
  Invite::OBJECT_NAME => Invite,
15
15
  Role::OBJECT_NAME => Role,
16
16
  Subscriber::OBJECT_NAME => Subscriber,
17
- UsageAlert::OBJECT_NAME => UsageAlert
17
+ UsageAlert::OBJECT_NAME => UsageAlert,
18
+ Feeds::OBJECT_NAME => Feeds
18
19
  }
19
20
  end
20
21
  end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Supercast
4
+ module Operations
5
+ module Feeds
6
+ module ClassMethods
7
+ # Enables the feeds of the identified resource with the passed in parameters.
8
+ #
9
+ # ==== Attributes
10
+ #
11
+ # * +id+ - ID of the resource to activate the feeds for.
12
+ # * +opts+ - A Hash of additional options to be added to the request.
13
+ def activate(id, opts = {})
14
+ params = { feed_token: { state: 'active' } }
15
+ request(:patch, "#{resource_url}/#{id}", params, opts)
16
+ true
17
+ end
18
+
19
+ # Suspends the feeds of the identified resource with the passed in parameters.
20
+ #
21
+ # ==== Attributes
22
+ #
23
+ # * +id+ - ID of the resource to suspend the feeds for.
24
+ # * +opts+ - A Hash of additional options to be added to the request.
25
+ def suspend(id, opts = {})
26
+ params = { feed_token: { state: 'suspended' } }
27
+ request(:patch, "#{resource_url}/#{id}", params, opts)
28
+ true
29
+ end
30
+
31
+ # Deactivate the feeds of the identified resource with the passed in parameters.
32
+ #
33
+ # ==== Attributes
34
+ #
35
+ # * +id+ - ID of the resource to deactivate the feeds for.
36
+ # * +opts+ - A Hash of additional options to be added to the request.
37
+ def deactivate(id, opts = {})
38
+ params = { feed_token: { state: 'inactive' } }
39
+ request(:patch, "#{resource_url}/#{id}", params, opts)
40
+ true
41
+ end
42
+ end
43
+
44
+ # Enables the feeds of the current resource.
45
+ #
46
+ # ==== Attributes
47
+ #
48
+ # * +opts+ - A Hash of additional options to be added to the request.
49
+ def activate(opts = {})
50
+ params = { feed_token: { state: 'active' } }
51
+ request(:patch, resource_url, params, opts)
52
+ true
53
+ end
54
+
55
+ # Suspends the feeds of the current resource.
56
+ #
57
+ # ==== Attributes
58
+ #
59
+ # * +opts+ - A Hash of additional options to be added to the request.
60
+ def suspend(opts = {})
61
+ params = { feed_token: { state: 'suspended' } }
62
+ request(:patch, resource_url, params, opts)
63
+ true
64
+ end
65
+
66
+ # Deactivate the feeds of the current resource.
67
+ #
68
+ # ==== Attributes
69
+ #
70
+ # * +opts+ - A Hash of additional options to be added to the request.
71
+ def deactivate(opts = {})
72
+ params = { feed_token: { state: 'inactive' } }
73
+ request(:patch, resource_url, params, opts)
74
+ true
75
+ end
76
+
77
+ def self.included(base)
78
+ base.extend(ClassMethods)
79
+ end
80
+ end
81
+ end
82
+ end
@@ -7,3 +7,4 @@ require_relative 'resources/invite'
7
7
  require_relative 'resources/role'
8
8
  require_relative 'resources/subscriber'
9
9
  require_relative 'resources/usage_alert'
10
+ require_relative 'resources/feeds'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Supercast
4
+ class Feeds < Resource
5
+ include Supercast::Operations::Feeds
6
+
7
+ OBJECT_NAME = 'feed'
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Supercast
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
@@ -15,6 +15,7 @@ RSpec.describe Supercast::DataTypes do
15
15
  expect(list['role']).to eq(Supercast::Role)
16
16
  expect(list['subscriber']).to eq(Supercast::Subscriber)
17
17
  expect(list['usage_alert']).to eq(Supercast::UsageAlert)
18
+ expect(list['feed']).to eq(Supercast::Feeds)
18
19
  end
19
20
  end
20
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supercast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Ell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2020-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -96,6 +96,7 @@ files:
96
96
  - lib/supercast/errors.rb
97
97
  - lib/supercast/operations/create.rb
98
98
  - lib/supercast/operations/destroy.rb
99
+ - lib/supercast/operations/feeds.rb
99
100
  - lib/supercast/operations/list.rb
100
101
  - lib/supercast/operations/request.rb
101
102
  - lib/supercast/operations/save.rb
@@ -104,6 +105,7 @@ files:
104
105
  - lib/supercast/resources/channel.rb
105
106
  - lib/supercast/resources/creator.rb
106
107
  - lib/supercast/resources/episode.rb
108
+ - lib/supercast/resources/feeds.rb
107
109
  - lib/supercast/resources/invite.rb
108
110
  - lib/supercast/resources/role.rb
109
111
  - lib/supercast/resources/subscriber.rb