cirro-ruby-client 2.2.1 → 2.3.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/.gitignore +3 -0
- data/Gemfile.lock +1 -1
- data/lib/cirro_io/client/version.rb +1 -1
- data/lib/cirro_io_v2/client.rb +5 -0
- data/lib/cirro_io_v2/resources/base.rb +0 -6
- data/lib/cirro_io_v2/resources/gig_invitation.rb +0 -3
- data/lib/cirro_io_v2/resources/notification_broadcast.rb +0 -3
- data/lib/cirro_io_v2/resources/notification_configuration.rb +0 -3
- data/lib/cirro_io_v2/resources/notification_layout.rb +0 -7
- data/lib/cirro_io_v2/resources/notification_layout_template.rb +0 -3
- data/lib/cirro_io_v2/resources/notification_locale.rb +0 -3
- data/lib/cirro_io_v2/resources/notification_template.rb +0 -5
- data/lib/cirro_io_v2/resources/notification_topic.rb +10 -5
- data/lib/cirro_io_v2/resources/notification_topic_preference.rb +0 -3
- data/lib/cirro_io_v2/resources/space_invitation.rb +10 -0
- data/lib/cirro_io_v2/responses/responses.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37a801e39bc51be2fec1f38fcdf9367a7f73dc82b21afc8cbd884ed47b61a173
|
4
|
+
data.tar.gz: 37a1366f9778231e64e8e2a7e14ec0a106bcf20288de3b4e44c8fb5735af04bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f90bd6e90a05f549e1b097b02a42ac1938855b59430981de07a41a659d65db4c525f971daa173ebca3898fb27a621e2611bba8f92cb0c482bbcd55f28d8d055
|
7
|
+
data.tar.gz: 7df252852f06b247ee9bc33495e9af16de7ab3d3a405b3dc3cb0a4c67097cf95a5134360f322ed3cc28bfb8c7e8c6b6a26fca22293b3b8a9b582c5514696571a
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/cirro_io_v2/client.rb
CHANGED
@@ -12,6 +12,7 @@ require 'cirro_io_v2/resources/gig_time_activity'
|
|
12
12
|
require 'cirro_io_v2/resources/payout'
|
13
13
|
require 'cirro_io_v2/resources/gig_invitation'
|
14
14
|
require 'cirro_io_v2/resources/user'
|
15
|
+
require 'cirro_io_v2/resources/space_invitation'
|
15
16
|
|
16
17
|
require 'cirro_io_v2/responses/base'
|
17
18
|
require 'cirro_io_v2/responses/responses'
|
@@ -64,6 +65,10 @@ module CirroIOV2
|
|
64
65
|
Resources::User.new(self)
|
65
66
|
end
|
66
67
|
|
68
|
+
def SpaceInvitation
|
69
|
+
Resources::SpaceInvitation.new(self)
|
70
|
+
end
|
71
|
+
|
67
72
|
def GigInvitation
|
68
73
|
Resources::GigInvitation.new(self)
|
69
74
|
end
|
@@ -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,29 +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
|
7
|
-
|
8
4
|
def list(params = nil)
|
9
5
|
response = client.request_client.request(:get, resource_root, params: params)
|
10
6
|
Responses::NotificationLayoutListResponse.new(response.body)
|
11
7
|
end
|
12
8
|
|
13
9
|
def create(params)
|
14
|
-
params_allowed?(params, CREATE_ALLOWED_PARAMS)
|
15
10
|
response = client.request_client.request(:post, resource_root, body: params)
|
16
11
|
Responses::NotificationLayoutResponse.new(response.body)
|
17
12
|
end
|
18
13
|
|
19
14
|
def update(id, params)
|
20
|
-
params_allowed?(params, UPDATE_ALLOWED_PARAMS)
|
21
15
|
response = client.request_client.request(:post, "#{resource_root}/#{id}", body: params)
|
22
16
|
Responses::NotificationLayoutResponse.new(response.body)
|
23
17
|
end
|
24
18
|
|
25
19
|
def create_template(id, params)
|
26
|
-
params_allowed?(params, CREATE_TEMPLATE_ALLOWED_PARAMS)
|
27
20
|
response = client.request_client.request(:post, "#{resource_root}/#{id}/notification_layout_templates", body: params)
|
28
21
|
Responses::NotificationLayoutTemplateResponse.new(response.body)
|
29
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
|
@@ -24,6 +24,10 @@ module CirroIOV2
|
|
24
24
|
include Base
|
25
25
|
end
|
26
26
|
|
27
|
+
SpaceInvitationResponse = Struct.new(:id, :object, :token, :subject, :email, :name, :inviter_name, :skip_background_check, :expires_at) do
|
28
|
+
include Base
|
29
|
+
end
|
30
|
+
|
27
31
|
GigResponse = Struct.new(:id,
|
28
32
|
:object,
|
29
33
|
:title,
|
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.
|
4
|
+
version: 2.3.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-
|
11
|
+
date: 2022-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/cirro_io_v2/resources/notification_topic.rb
|
141
141
|
- lib/cirro_io_v2/resources/notification_topic_preference.rb
|
142
142
|
- lib/cirro_io_v2/resources/payout.rb
|
143
|
+
- lib/cirro_io_v2/resources/space_invitation.rb
|
143
144
|
- lib/cirro_io_v2/resources/user.rb
|
144
145
|
- lib/cirro_io_v2/responses/base.rb
|
145
146
|
- lib/cirro_io_v2/responses/responses.rb
|