cirro-ruby-client 2.2.0 → 2.2.2

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: 3a120d9a51454b845c16158501e4ef77ac0cc24e6e64533e9c4d36222e8d6b96
4
- data.tar.gz: 5e710de314860b7e51321e15a8280054a95aa11965aeea426aff74c73481a0d0
3
+ metadata.gz: e38b544e357fb8b73b991bb73e6b6409710963e99ee8c466b44d2004e7ef9756
4
+ data.tar.gz: 75514bb4366e628f4f4a3ea7322882b53d8d0163aab6f98b726137c5a80d834c
5
5
  SHA512:
6
- metadata.gz: e2aecfa0f10747956ad0cf2970a50ae4256b5abff46934af65287a7a03e782b699e751413e89eaee7c9657717940905b6752be6d54b35a8043b9e47ca231b680
7
- data.tar.gz: 19ed5dae962259b8246e38f97e92142bfd3334049079140ed3052771c384b5c5170335196d00f04a89fd754ad310b1805cc594ec7f470d6fe55c521734b1df34
6
+ metadata.gz: 796756299cd7a820817becfe69dcec2dfafdbe0329a8680c00b20a5e2e3ce83ec5a4fbc90c355e0dfe19f90d33168bd492b3246cc530920116d40c9d01553986
7
+ data.tar.gz: 15b64781700c3492eabb97e29fd232f7708c27eae3767326d50943c85d0d25b3b763acaaf3afccbbd6dcffcccf07d2bced2e50510d3cd999116fe520edce3ef1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cirro-ruby-client (2.2.0)
4
+ cirro-ruby-client (2.2.2)
5
5
  activesupport
6
6
  faraday (< 1.2.0)
7
7
  faraday_middleware
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Style/MutableConstant
2
2
  module CirroIO
3
3
  module Client
4
- VERSION = '2.2.0'
4
+ VERSION = '2.2.2'
5
5
  end
6
6
  end
7
7
  # rubocop:enable Style/MutableConstant
@@ -1,5 +1,3 @@
1
- require 'active_support/core_ext/string/inflections'
2
-
3
1
  module CirroIOV2
4
2
  module Resources
5
3
  class Base
@@ -12,10 +10,6 @@ module CirroIOV2
12
10
  def resource_root
13
11
  self.class.name.demodulize.underscore.pluralize
14
12
  end
15
-
16
- def params_allowed?(params, allowed)
17
- raise 'ParamNotAllowed' if (params.keys - allowed).any?
18
- end
19
13
  end
20
14
  end
21
15
  end
@@ -1,10 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class GigInvitation < Base
4
- ALLOWED_PARAMS = [:user_id, :gig_id, :limit, :before, :after, :status].freeze
5
-
6
4
  def list(params = nil)
7
- params_allowed?(params, ALLOWED_PARAMS) if params
8
5
  response = client.request_client.request(:get, resource_root, params: params)
9
6
  Responses::GigInvitationListResponse.new(response.body)
10
7
  end
@@ -1,10 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationBroadcast < Base
4
- ALLOWED_PARAMS = [:payload, :recipients, :notification_topic_id].freeze
5
-
6
4
  def create(params)
7
- params_allowed?(params, ALLOWED_PARAMS)
8
5
  response = client.request_client.request(:post, resource_root, body: params)
9
6
  Responses::NotificationBroadcastResponse.new(response.body)
10
7
  end
@@ -1,10 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationConfiguration < Base
4
- ALLOWED_PARAMS = [:locale, :limit, :before, :after].freeze
5
-
6
4
  def list(params = nil)
7
- params_allowed?(params, ALLOWED_PARAMS) if params
8
5
  response = client.request_client.request(:get, resource_root, params: params)
9
6
  Responses::NotificationConfigurationListResponse.new(response.body)
10
7
  end
@@ -1,24 +1,22 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationLayout < Base
4
- CREATE_ALLOWED_PARAMS = [:name, :templates].freeze
5
- UPDATE_ALLOWED_PARAMS = [:name].freeze
6
- CREATE_TEMPLATE_ALLOWED_PARAMS = [:notification_configuration_id, :body].freeze
4
+ def list(params = nil)
5
+ response = client.request_client.request(:get, resource_root, params: params)
6
+ Responses::NotificationLayoutListResponse.new(response.body)
7
+ end
7
8
 
8
9
  def create(params)
9
- params_allowed?(params, CREATE_ALLOWED_PARAMS)
10
10
  response = client.request_client.request(:post, resource_root, body: params)
11
11
  Responses::NotificationLayoutResponse.new(response.body)
12
12
  end
13
13
 
14
14
  def update(id, params)
15
- params_allowed?(params, UPDATE_ALLOWED_PARAMS)
16
15
  response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
17
16
  Responses::NotificationLayoutResponse.new(response.body)
18
17
  end
19
18
 
20
19
  def create_template(id, params)
21
- params_allowed?(params, CREATE_TEMPLATE_ALLOWED_PARAMS)
22
20
  response = client.request_client.request(:post, "#{resource_root}/#{id}/notification_layout_templates", body: params)
23
21
  Responses::NotificationLayoutTemplateResponse.new(response.body)
24
22
  end
@@ -1,10 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationLayoutTemplate < Base
4
- UPDATE_ALLOWED_PARAMS = [:notification_configuration_id, :body].freeze
5
-
6
4
  def update(id, params)
7
- params_allowed?(params, UPDATE_ALLOWED_PARAMS)
8
5
  response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
9
6
  Responses::NotificationLayoutTemplateResponse.new(response.body)
10
7
  end
@@ -1,10 +1,7 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationLocale < Base
4
- ALLOWED_PARAMS = [:locale].freeze
5
-
6
4
  def create(params)
7
- params_allowed?(params, ALLOWED_PARAMS)
8
5
  response = client.request_client.request(:post, resource_root, body: params)
9
6
  Responses::NotificationLocaleResponse.new(response.body)
10
7
  end
@@ -1,17 +1,12 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationTemplate < Base
4
- LIST_ALLOWED_PARAMS = [:notification_configuration_id, :notification_topic_id, :limit, :before, :after].freeze
5
- UPDATE_ALLOWED_PARAMS = [:subject, :body].freeze
6
-
7
4
  def list(params = nil)
8
- params_allowed?(params, LIST_ALLOWED_PARAMS) if params
9
5
  response = client.request_client.request(:get, resource_root, params: params)
10
6
  Responses::NotificationTemplateListResponse.new(response.body)
11
7
  end
12
8
 
13
9
  def update(id, params)
14
- params_allowed?(params, UPDATE_ALLOWED_PARAMS)
15
10
  response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
16
11
  Responses::NotificationTemplateResponse.new(response.body)
17
12
  end
@@ -1,21 +1,26 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationTopic < Base
4
- ALLOWED_PARAMS = [:name, :notification_layout_id, :preferences, :templates].freeze
5
- ALLOWED_LIST_PARAMS = [:notification_layout_id, :limit, :before, :after].freeze
6
-
7
4
  def resource_root
8
5
  'notification_topics'
9
6
  end
10
7
 
8
+ def find(id)
9
+ response = client.request_client.request(:get, "#{resource_root}/#{id}")
10
+ Responses::NotificationTopicResponse.new(response.body)
11
+ end
12
+
13
+ def update(id, params)
14
+ response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
15
+ Responses::NotificationTopicResponse.new(response.body)
16
+ end
17
+
11
18
  def list(params = nil)
12
- params_allowed?(params, ALLOWED_LIST_PARAMS) if params
13
19
  response = client.request_client.request(:get, resource_root, params: params)
14
20
  Responses::NotificationTopicListResponse.new(response.body)
15
21
  end
16
22
 
17
23
  def create(params)
18
- params_allowed?(params, ALLOWED_PARAMS)
19
24
  response = client.request_client.request(:post, resource_root, body: params)
20
25
  Responses::NotificationTopicResponse.new(response.body)
21
26
  end
@@ -1,14 +1,11 @@
1
1
  module CirroIOV2
2
2
  module Resources
3
3
  class NotificationTopicPreference < Base
4
- ALLOWED_PARAMS = [:user_id, :notification_topic_id, :limit, :before, :after].freeze
5
-
6
4
  def resource_root
7
5
  'notification_topic_preferences'
8
6
  end
9
7
 
10
8
  def list(params = nil)
11
- params_allowed?(params, ALLOWED_PARAMS) if params
12
9
  response = client.request_client.request(:get, resource_root, params: params)
13
10
  Responses::NotificationTopicPreferenceListResponse.new(response.body)
14
11
  end
@@ -8,6 +8,7 @@ module CirroIOV2
8
8
  :PayoutListResponse,
9
9
  :NotificationTopicPreferenceListResponse,
10
10
  :NotificationLocaleListResponse,
11
+ :NotificationLayoutListResponse,
11
12
  :NotificationConfigurationListResponse,
12
13
  :NotificationLayoutTemplateListResponse,
13
14
  :NotificationTopicListResponse,
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.2.0
4
+ version: 2.2.2
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-09-26 00:00:00.000000000 Z
11
+ date: 2022-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport