cirro-ruby-client 2.0.1 → 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: 76097208caab26d55fe43bc4ca78e868d65c7fbd0aa0ab172cf76fbe51b769dc
4
- data.tar.gz: 4e5db26e12fc65b9a8bb0da9a75ce846d9d8f5a0054f8cca47fe2ded2830a458
3
+ metadata.gz: cb241151c08978a8fea7a2b594440dd63ea330620c3e2e75c392bf78c4e85a9a
4
+ data.tar.gz: 32028d6fd708791bb8ef147a6149d3eb8ee54739ee01d384c5929a2c56b6ba11
5
5
  SHA512:
6
- metadata.gz: c7af16a9900b76331bc9c248f8b22ca38f6e34b8affc1cbf54cf8d60eed55b915315b84e09bf654bc82b0a15ceb79cefbba8d88b3f1901739d87a57a0f000df8
7
- data.tar.gz: 2299039507bef30f4bc613faf0107f2dec238c113903b92213f9f248d84ef276c6c4e5b31484c3b3839249de308afdabcb8e9ed8ffbfb173e03bc314aaaa31c8
6
+ metadata.gz: afd6cc918fda461905fe9ffd2a91492c40fa7feaa7ae82f7fc6c216b8448e04fad95f510bc7da0e4fe33f90ec1bf27b73270d21f6027f02cd2e8154033d41c21
7
+ data.tar.gz: 53e4c74b781b0d695d9f85d08e9524bca54aa2a4c59c3bf7875e23051468df25320ff271df34c7af0985da9ea755ef180f94ff49deed44745b672c83cef0f490
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cirro-ruby-client (2.0.1)
4
+ cirro-ruby-client (2.1.0)
5
5
  activesupport
6
6
  faraday (< 1.2.0)
7
7
  faraday_middleware
@@ -110,4 +110,4 @@ DEPENDENCIES
110
110
  webmock
111
111
 
112
112
  BUNDLED WITH
113
- 2.3.4
113
+ 2.3.20
data/README.md CHANGED
@@ -111,7 +111,7 @@ preference.id
111
111
  preference.locale
112
112
  # => 'de'
113
113
 
114
- preference.channels
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
- channels: [
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 channel
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 (Channel) Template
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 channel id
349
- client.NotificationTemplate.list(notification_channel_id: 1)
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 Channel Preference
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 channel id
387
- client.NotificationTopicPreference.list(notification_channel_id: 1)
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
- notification_channel_id: 1
408
+ notification_topic_id: 1
409
409
  )
410
410
  ```
@@ -1,7 +1,7 @@
1
1
  module CirroIO
2
2
  module Client
3
3
  class NotificationsBroadcast < Base
4
- has_one :channel, class_name: 'NotificationsChannel'
4
+ has_one :topic, class_name: 'NotificationsTopic'
5
5
  has_one :worker_filter
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module CirroIO
2
2
  module Client
3
3
  class NotificationsTemplate < Base
4
- has_one :channel, class_name: 'NotificationsChannel'
4
+ has_one :topic, class_name: 'NotificationsTopic'
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  module CirroIO
2
2
  module Client
3
- class NotificationsChannel < Base
3
+ class NotificationsTopic < Base
4
4
  end
5
5
  end
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Style/MutableConstant
2
2
  module CirroIO
3
3
  module Client
4
- VERSION = '2.0.1'
4
+ VERSION = '2.1.0'
5
5
  end
6
6
  end
7
7
  # rubocop:enable Style/MutableConstant
@@ -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/notifications_channel'
19
+ require 'cirro_io/client/notifications_topic'
20
20
  require 'cirro_io/client/notifications_template'
21
21
 
22
22
  module CirroIO
@@ -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/gig_ivitation'
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 NotificationChannelPreference
77
- Resources::NotificationChannelPreference.new(self)
76
+ def NotificationTopicPreference
77
+ Resources::NotificationTopicPreference.new(self)
78
78
  end
79
79
 
80
- def NotificationChannel
81
- Resources::NotificationChannel.new(self)
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
@@ -13,6 +13,7 @@ module CirroIOV2
13
13
 
14
14
  @connection = Faraday.new(url: base_url) do |conn|
15
15
  conn.request :json
16
+ conn.response :raise_error
16
17
  conn.response :json
17
18
  conn.adapter Faraday.default_adapter # testIO App is on older version of faraday and needs this line
18
19
  end
@@ -1,7 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationBroadcast < Base
4
- ALLOWED_PARAMS = [:payload, :recipients, :notification_channel_id].freeze
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, :notification_channel_id, :limit, :before, :after].freeze
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
- 'notification_channels'
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::NotificationChannelResponse.new(response.body)
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, :notification_channel_id, :limit, :before, :after].freeze
4
+ ALLOWED_PARAMS = [:user_id, :notification_topic_id, :limit, :before, :after].freeze
5
5
 
6
6
  def resource_root
7
- 'notification_channel_preferences'
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::NotificationChannelPreferenceListResponse.new(response.body)
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
- :NotificationChannelPreferenceListResponse,
6
+ :NotificationTopicPreferenceListResponse,
7
7
  :NotificationLocaleListResponse,
8
8
  :NotificationConfigurationListResponse,
9
9
  :NotificationLayoutTemplateListResponse,
10
- :NotificationChannelListResponse,
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, :channels) do
19
- self::NESTED_RESPONSES = { channels: :NotificationChannelListResponse }.freeze
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
- NotificationChannelPreferenceResponse = Struct.new(:id, :object, :preferences, :notification_channel_id, :user_id) do
49
- self::NESTED_RESPONSES = { preferences: :NotificationChannelPreferenceListResponse }.freeze
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
- NotificationChannelResponse = Struct.new(:id, :object, :name, :notification_layout_id, :preferences, :templates) do
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, :notification_channel_id, :subject, :body) do
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, :notification_channel_id) do
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.1
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-17 00:00:00.000000000 Z
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/gig_ivitation.rb
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.0.3.1
165
+ rubygems_version: 3.1.3
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Ruby client library for Cirro API