cirro-ruby-client 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +12 -12
- data/lib/cirro_io/client/notifications_broadcast.rb +1 -1
- data/lib/cirro_io/client/notifications_template.rb +1 -1
- data/lib/cirro_io/client/{notifications_channel.rb → notifications_topic.rb} +1 -1
- data/lib/cirro_io/client/version.rb +1 -1
- data/lib/cirro_io/client.rb +1 -1
- data/lib/cirro_io_v2/client.rb +5 -9
- data/lib/cirro_io_v2/request_clients/jwt.rb +1 -0
- data/lib/cirro_io_v2/resources/{gig_ivitation.rb → gig_invitation.rb} +0 -0
- data/lib/cirro_io_v2/resources/notification_broadcast.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_template.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_topic.rb +9 -2
- data/lib/cirro_io_v2/resources/notification_topic_preference.rb +3 -3
- data/lib/cirro_io_v2/responses/responses.rb +9 -9
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb241151c08978a8fea7a2b594440dd63ea330620c3e2e75c392bf78c4e85a9a
|
4
|
+
data.tar.gz: 32028d6fd708791bb8ef147a6149d3eb8ee54739ee01d384c5929a2c56b6ba11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afd6cc918fda461905fe9ffd2a91492c40fa7feaa7ae82f7fc6c216b8448e04fad95f510bc7da0e4fe33f90ec1bf27b73270d21f6027f02cd2e8154033d41c21
|
7
|
+
data.tar.gz: 53e4c74b781b0d695d9f85d08e9524bca54aa2a4c59c3bf7875e23051468df25320ff271df34c7af0985da9ea755ef180f94ff49deed44745b672c83cef0f490
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -111,7 +111,7 @@ preference.id
|
|
111
111
|
preference.locale
|
112
112
|
# => 'de'
|
113
113
|
|
114
|
-
preference.
|
114
|
+
preference.topics
|
115
115
|
# => Array of NotificationTopicPreference objects
|
116
116
|
```
|
117
117
|
|
@@ -120,7 +120,7 @@ preference.channels
|
|
120
120
|
```ruby
|
121
121
|
client.User.update_notification_preference({
|
122
122
|
locale: 'de',
|
123
|
-
|
123
|
+
topics: [
|
124
124
|
{ id: '1', preferences: { email: 'immediately' } },
|
125
125
|
{ id: '2', preferences: { email: 'digest_daily' } }
|
126
126
|
]
|
@@ -292,7 +292,7 @@ client.NotificationLayoutTemplate.delete('1')
|
|
292
292
|
### List all notification topics
|
293
293
|
|
294
294
|
```ruby
|
295
|
-
list = client.NotificationTopic
|
295
|
+
list = client.NotificationTopic.list
|
296
296
|
# => ListObject
|
297
297
|
|
298
298
|
list.has_more?
|
@@ -308,7 +308,7 @@ client.NotificationTopic.list(notification_layout_id: 1)
|
|
308
308
|
client.NotificationTopic.list(limit: 10, after: 10)
|
309
309
|
```
|
310
310
|
|
311
|
-
### Create a notification
|
311
|
+
### Create a notification topic
|
312
312
|
|
313
313
|
```ruby
|
314
314
|
client.NotificationTopic.create(
|
@@ -332,11 +332,11 @@ client.NotificationTopic.create(
|
|
332
332
|
)
|
333
333
|
```
|
334
334
|
|
335
|
-
## Notification (
|
335
|
+
## Notification (Topic) Template
|
336
336
|
### List all
|
337
337
|
|
338
338
|
```ruby
|
339
|
-
list = client.NotificationTemplate
|
339
|
+
list = client.NotificationTemplate.list
|
340
340
|
# => ListObject
|
341
341
|
|
342
342
|
list.has_more?
|
@@ -345,8 +345,8 @@ list.has_more?
|
|
345
345
|
list.data
|
346
346
|
# => Array of NotificationTemplate objects
|
347
347
|
|
348
|
-
# filter by
|
349
|
-
client.NotificationTemplate.list(
|
348
|
+
# filter by topic id
|
349
|
+
client.NotificationTemplate.list(notification_topic_id: 1)
|
350
350
|
|
351
351
|
# filter by configuration id
|
352
352
|
client.NotificationTemplate.list(notification_configuration_id: 1)
|
@@ -370,7 +370,7 @@ client.NotificationTemplate.update(
|
|
370
370
|
```ruby
|
371
371
|
client.NotificationTemplate.delete('1')
|
372
372
|
```
|
373
|
-
## Notifcation
|
373
|
+
## Notifcation Topic Preference
|
374
374
|
### List all
|
375
375
|
|
376
376
|
```ruby
|
@@ -383,8 +383,8 @@ list.has_more?
|
|
383
383
|
list.data
|
384
384
|
# => Array of NotificationTopicPreference objects
|
385
385
|
|
386
|
-
# filter by
|
387
|
-
client.NotificationTopicPreference.list(
|
386
|
+
# filter by topic id
|
387
|
+
client.NotificationTopicPreference.list(notification_topic_id: 1)
|
388
388
|
|
389
389
|
# filter by user id
|
390
390
|
client.NotificationTopicPreference.list(user_id: 1)
|
@@ -405,6 +405,6 @@ client.NotificationBroadcast.create(
|
|
405
405
|
recipients: {
|
406
406
|
user_ids: [1, 2, 3]
|
407
407
|
},
|
408
|
-
|
408
|
+
notification_topic_id: 1
|
409
409
|
)
|
410
410
|
```
|
data/lib/cirro_io/client.rb
CHANGED
@@ -16,7 +16,7 @@ require 'cirro_io/client/gig_time_activity'
|
|
16
16
|
require 'cirro_io/client/gig'
|
17
17
|
require 'cirro_io/client/payout'
|
18
18
|
require 'cirro_io/client/notifications_broadcast'
|
19
|
-
require 'cirro_io/client/
|
19
|
+
require 'cirro_io/client/notifications_topic'
|
20
20
|
require 'cirro_io/client/notifications_template'
|
21
21
|
|
22
22
|
module CirroIO
|
data/lib/cirro_io_v2/client.rb
CHANGED
@@ -7,7 +7,7 @@ require 'cirro_io_v2/request_clients/jwt'
|
|
7
7
|
|
8
8
|
require 'cirro_io_v2/resources/base'
|
9
9
|
require 'cirro_io_v2/resources/gig'
|
10
|
-
require 'cirro_io_v2/resources/
|
10
|
+
require 'cirro_io_v2/resources/gig_invitation'
|
11
11
|
require 'cirro_io_v2/resources/user'
|
12
12
|
|
13
13
|
require 'cirro_io_v2/responses/base'
|
@@ -73,12 +73,12 @@ module CirroIOV2
|
|
73
73
|
Resources::NotificationBroadcast.new(self)
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
77
|
-
Resources::
|
76
|
+
def NotificationTopicPreference
|
77
|
+
Resources::NotificationTopicPreference.new(self)
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
Resources::
|
80
|
+
def NotificationTopic
|
81
|
+
Resources::NotificationTopic.new(self)
|
82
82
|
end
|
83
83
|
|
84
84
|
def NotificationConfiguration
|
@@ -101,10 +101,6 @@ module CirroIOV2
|
|
101
101
|
Resources::NotificationTopic.new(self)
|
102
102
|
end
|
103
103
|
|
104
|
-
def NotificationTopic
|
105
|
-
Resources::NotificationTopic.new(self)
|
106
|
-
end
|
107
|
-
|
108
104
|
# rubocop:enable Naming/MethodName
|
109
105
|
end
|
110
106
|
end
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CirroIOV2
|
2
2
|
module Resources
|
3
3
|
class NotificationBroadcast < Base
|
4
|
-
ALLOWED_PARAMS = [:payload, :recipients, :
|
4
|
+
ALLOWED_PARAMS = [:payload, :recipients, :notification_topic_id].freeze
|
5
5
|
|
6
6
|
def create(params)
|
7
7
|
params_allowed?(params, ALLOWED_PARAMS)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CirroIOV2
|
2
2
|
module Resources
|
3
3
|
class NotificationTemplate < Base
|
4
|
-
LIST_ALLOWED_PARAMS = [:notification_configuration_id, :
|
4
|
+
LIST_ALLOWED_PARAMS = [:notification_configuration_id, :notification_topic_id, :limit, :before, :after].freeze
|
5
5
|
UPDATE_ALLOWED_PARAMS = [:subject, :body].freeze
|
6
6
|
|
7
7
|
def list(params = nil)
|
@@ -2,15 +2,22 @@ module CirroIOV2
|
|
2
2
|
module Resources
|
3
3
|
class NotificationTopic < Base
|
4
4
|
ALLOWED_PARAMS = [:name, :notification_layout_id, :preferences, :templates].freeze
|
5
|
+
ALLOWED_LIST_PARAMS = [:notification_layout_id, :limit, :before, :after].freeze
|
5
6
|
|
6
7
|
def resource_root
|
7
|
-
'
|
8
|
+
'notification_topics'
|
9
|
+
end
|
10
|
+
|
11
|
+
def list(params = nil)
|
12
|
+
params_allowed?(params, ALLOWED_LIST_PARAMS) if params
|
13
|
+
response = client.request_client.request(:get, resource_root, params: params)
|
14
|
+
Responses::NotificationTopicListResponse.new(response.body)
|
8
15
|
end
|
9
16
|
|
10
17
|
def create(params)
|
11
18
|
params_allowed?(params, ALLOWED_PARAMS)
|
12
19
|
response = client.request_client.request(:post, resource_root, body: params)
|
13
|
-
Responses::
|
20
|
+
Responses::NotificationTopicResponse.new(response.body)
|
14
21
|
end
|
15
22
|
end
|
16
23
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module CirroIOV2
|
2
2
|
module Resources
|
3
3
|
class NotificationTopicPreference < Base
|
4
|
-
ALLOWED_PARAMS = [:user_id, :
|
4
|
+
ALLOWED_PARAMS = [:user_id, :notification_topic_id, :limit, :before, :after].freeze
|
5
5
|
|
6
6
|
def resource_root
|
7
|
-
'
|
7
|
+
'notification_topic_preferences'
|
8
8
|
end
|
9
9
|
|
10
10
|
def list(params = nil)
|
11
11
|
params_allowed?(params, ALLOWED_PARAMS) if params
|
12
12
|
response = client.request_client.request(:get, resource_root, params: params)
|
13
|
-
Responses::
|
13
|
+
Responses::NotificationTopicPreferenceListResponse.new(response.body)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -3,11 +3,11 @@ module CirroIOV2
|
|
3
3
|
LIST_RESPONSES = [
|
4
4
|
:GigTaskListResponse,
|
5
5
|
:GigInvitationListResponse,
|
6
|
-
:
|
6
|
+
:NotificationTopicPreferenceListResponse,
|
7
7
|
:NotificationLocaleListResponse,
|
8
8
|
:NotificationConfigurationListResponse,
|
9
9
|
:NotificationLayoutTemplateListResponse,
|
10
|
-
:
|
10
|
+
:NotificationTopicListResponse,
|
11
11
|
:NotificationTemplateListResponse,
|
12
12
|
].freeze
|
13
13
|
|
@@ -15,8 +15,8 @@ module CirroIOV2
|
|
15
15
|
include Base
|
16
16
|
end
|
17
17
|
|
18
|
-
UserNotificationPreferenceResponse = Struct.new(:id, :object, :locale, :
|
19
|
-
self::NESTED_RESPONSES = {
|
18
|
+
UserNotificationPreferenceResponse = Struct.new(:id, :object, :locale, :topics) do
|
19
|
+
self::NESTED_RESPONSES = { topics: :NotificationTopicListResponse }.freeze
|
20
20
|
include Base
|
21
21
|
end
|
22
22
|
|
@@ -45,8 +45,8 @@ module CirroIOV2
|
|
45
45
|
include Base
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
self::NESTED_RESPONSES = { preferences: :
|
48
|
+
NotificationTopicPreferenceResponse = Struct.new(:id, :object, :preferences, :notification_topic_id, :user_id) do
|
49
|
+
self::NESTED_RESPONSES = { preferences: :NotificationTopicPreferenceListResponse }.freeze
|
50
50
|
include Base
|
51
51
|
end
|
52
52
|
|
@@ -72,12 +72,12 @@ module CirroIOV2
|
|
72
72
|
include Base
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
NotificationTopicResponse = Struct.new(:id, :object, :name, :notification_layout_id, :preferences, :templates) do
|
76
76
|
self::NESTED_RESPONSES = { templates: :NotificationTemplateListResponse }.freeze
|
77
77
|
include Base
|
78
78
|
end
|
79
79
|
|
80
|
-
NotificationTemplateResponse = Struct.new(:id, :object, :notification_configuration_id, :
|
80
|
+
NotificationTemplateResponse = Struct.new(:id, :object, :notification_configuration_id, :notification_topic_id, :subject, :body) do
|
81
81
|
include Base
|
82
82
|
end
|
83
83
|
|
@@ -85,7 +85,7 @@ module CirroIOV2
|
|
85
85
|
include Base
|
86
86
|
end
|
87
87
|
|
88
|
-
NotificationBroadcastResponse = Struct.new(:id, :object, :payload, :recipients, :
|
88
|
+
NotificationBroadcastResponse = Struct.new(:id, :object, :payload, :recipients, :notification_topic_id) do
|
89
89
|
include Base
|
90
90
|
end
|
91
91
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cirro-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cirro Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -115,8 +115,8 @@ files:
|
|
115
115
|
- lib/cirro_io/client/gig_time_activity.rb
|
116
116
|
- lib/cirro_io/client/jwt_authentication.rb
|
117
117
|
- lib/cirro_io/client/notifications_broadcast.rb
|
118
|
-
- lib/cirro_io/client/notifications_channel.rb
|
119
118
|
- lib/cirro_io/client/notifications_template.rb
|
119
|
+
- lib/cirro_io/client/notifications_topic.rb
|
120
120
|
- lib/cirro_io/client/payout.rb
|
121
121
|
- lib/cirro_io/client/response_debugging_middleware.rb
|
122
122
|
- lib/cirro_io/client/version.rb
|
@@ -128,7 +128,7 @@ files:
|
|
128
128
|
- lib/cirro_io_v2/request_clients/jwt.rb
|
129
129
|
- lib/cirro_io_v2/resources/base.rb
|
130
130
|
- lib/cirro_io_v2/resources/gig.rb
|
131
|
-
- lib/cirro_io_v2/resources/
|
131
|
+
- lib/cirro_io_v2/resources/gig_invitation.rb
|
132
132
|
- lib/cirro_io_v2/resources/notification_broadcast.rb
|
133
133
|
- lib/cirro_io_v2/resources/notification_configuration.rb
|
134
134
|
- lib/cirro_io_v2/resources/notification_layout.rb
|
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
165
|
+
rubygems_version: 3.1.3
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: Ruby client library for Cirro API
|