qismo 0.13.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/qismo/api.rb +556 -324
  3. data/lib/qismo/client.rb +31 -19
  4. data/lib/qismo/collection.rb +21 -0
  5. data/lib/qismo/object.rb +21 -0
  6. data/lib/qismo/objectified_hash.rb +30 -0
  7. data/lib/qismo/objects/agent_service.rb +53 -0
  8. data/lib/qismo/objects/broadcast_job.rb +99 -0
  9. data/lib/qismo/objects/broadcast_log.rb +59 -0
  10. data/lib/qismo/objects/custom_channel.rb +35 -0
  11. data/lib/qismo/objects/custom_channel_message_response.rb +19 -0
  12. data/lib/qismo/objects/customer_room.rb +85 -0
  13. data/lib/qismo/objects/fb_channel.rb +31 -0
  14. data/lib/qismo/objects/hsm_template.rb +111 -0
  15. data/lib/qismo/objects/ig_channel.rb +43 -0
  16. data/lib/qismo/objects/line_channel.rb +27 -0
  17. data/lib/qismo/objects/list_channels_response.rb +39 -0
  18. data/lib/qismo/objects/office_hour.rb +67 -0
  19. data/lib/qismo/objects/qiscus_channel.rb +27 -0
  20. data/lib/qismo/objects/room_additional_info.rb +15 -0
  21. data/lib/qismo/objects/tag.rb +27 -0
  22. data/lib/qismo/objects/telegram_channel.rb +31 -0
  23. data/lib/qismo/objects/user.rb +99 -0
  24. data/lib/qismo/objects/wa_channel.rb +111 -0
  25. data/lib/qismo/objects/wa_credit_info.rb +71 -0
  26. data/lib/qismo/objects/waca_channel.rb +55 -0
  27. data/lib/qismo/objects/webhook.rb +15 -0
  28. data/lib/qismo/types.rb +10 -1
  29. data/lib/qismo/version.rb +1 -1
  30. data/lib/qismo/webhook_requests/on_agent_allocation_needed.rb +8 -2
  31. data/lib/qismo/webhook_requests/on_custom_button_clicked.rb +15 -7
  32. data/lib/qismo/webhook_requests/on_custom_channel_message_sent.rb +18 -6
  33. data/lib/qismo/webhook_requests/on_message_for_bot_sent.rb +18 -6
  34. data/lib/qismo/webhook_requests/on_new_session_initiated.rb +30 -10
  35. data/lib/qismo/webhook_requests/on_room_resolved.rb +15 -5
  36. data/lib/qismo.rb +28 -34
  37. data/qismo.gemspec +1 -0
  38. metadata +40 -6
  39. data/lib/qismo/model.rb +0 -102
  40. data/lib/qismo/models/base.rb +0 -13
  41. data/lib/qismo/models/customer_room.rb +0 -6
  42. data/lib/qismo/util.rb +0 -31
@@ -0,0 +1,43 @@
1
+ module Qismo
2
+ module Objects
3
+ # IG channel object
4
+ #
5
+ class IgChannel < Qismo::Object
6
+ # @!attribute [r] id
7
+ # @return [Integer]
8
+ attribute? :id, Types::Int.optional
9
+
10
+ # @!attribute [r] is_active
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :is_active, Types::Bool.optional
13
+
14
+ # @!attribute [r] name
15
+ # @return [String]
16
+ attribute? :name, Types::String.optional
17
+
18
+ # @!attribute [r] page_id
19
+ # @return [String]
20
+ attribute? :page_id, Types::String.optional
21
+
22
+ # @!attribute [r] badge_url
23
+ # @return [String]
24
+ attribute? :badge_url, Types::String.optional
25
+
26
+ # @!attribute [r] use_channel_responder
27
+ # @return [TrueClass,FalseClass]
28
+ attribute? :use_channel_responder, Types::Bool.optional
29
+
30
+ # @!attribute [r] ig_id
31
+ # @return [String]
32
+ attribute? :ig_id, Types::String.optional
33
+
34
+ # @!attribute [r] private_replies_enabled
35
+ # @return [TrueClass,FalseClass]
36
+ attribute? :private_replies_enabled, Types::Bool.optional
37
+
38
+ # @!attribute [r] private_replies_text
39
+ # @return [String]
40
+ attribute? :private_replies_text, Types::String.optional
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,27 @@
1
+ module Qismo
2
+ module Objects
3
+ # Line channel object
4
+ #
5
+ class LineChannel < Qismo::Object
6
+ # @!attribute [r] id
7
+ # @return [Integer]
8
+ attribute? :id, Types::Int.optional
9
+
10
+ # @!attribute [r] is_active
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :is_active, Types::Bool.optional
13
+
14
+ # @!attribute [r] badge_url
15
+ # @return [String]
16
+ attribute? :badge_url, Types::String.optional
17
+
18
+ # @!attribute [r] name
19
+ # @return [String]
20
+ attribute? :name, Types::String.optional
21
+
22
+ # @!attribute [r] use_channel_responder
23
+ # @return [TrueClass,FalseClass]
24
+ attribute? :use_channel_responder, Types::Bool.optional
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,39 @@
1
+ module Qismo
2
+ module Objects
3
+ # List channels response object
4
+ #
5
+ class ListChannelsResponse < Qismo::Object
6
+ # @!attribute [r] custom_channels
7
+ # @return [Array<Qismo::Objects::CustomChannel>]
8
+ attribute? :custom_channels, Types.Array(Qismo::Objects::CustomChannel.optional).optional
9
+
10
+ # @!attribute [r] fb_channels
11
+ # @return [Array<Qismo::Objects::FbChannel>]
12
+ attribute? :fb_channels, Types.Array(Qismo::Objects::FbChannel.optional).optional
13
+
14
+ # @!attribute [r] ig_channels
15
+ # @return [Array<Qismo::Objects::IgChannel>]
16
+ attribute? :ig_channels, Types.Array(Qismo::Objects::IgChannel.optional).optional
17
+
18
+ # @!attribute [r] line_channels
19
+ # @return [Array<Qismo::Objects::LineChannel>]
20
+ attribute? :line_channels, Types.Array(Qismo::Objects::LineChannel.optional).optional
21
+
22
+ # @!attribute [r] qiscus_channels
23
+ # @return [Array<Qismo::Objects::QiscusChannel>]
24
+ attribute? :qiscus_channels, Types.Array(Qismo::Objects::QiscusChannel.optional).optional
25
+
26
+ # @!attribute [r] telegram_channels
27
+ # @return [Array<Qismo::Objects::TelegramChannel>]
28
+ attribute? :telegram_channels, Types.Array(Qismo::Objects::TelegramChannel.optional).optional
29
+
30
+ # @!attribute [r] wa_channels
31
+ # @return [Array<Qismo::Objects::WaChannel>]
32
+ attribute? :wa_channels, Types.Array(Qismo::Objects::WaChannel.optional).optional
33
+
34
+ # @!attribute [r] waca_channels
35
+ # @return [Array<Qismo::Objects::WacaChannel>]
36
+ attribute? :waca_channels, Types.Array(Qismo::Objects::WacaChannel.optional).optional
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,67 @@
1
+ module Qismo
2
+ module Objects
3
+ # Office hour object
4
+ #
5
+ class OfficeHour < Qismo::Object
6
+ # Office hour element object
7
+ #
8
+ class OfficeHourElement < Qismo::Object
9
+ # @!attribute [r] day
10
+ # @return [Integer]
11
+ attribute? :day, Types::Int.optional
12
+
13
+ # @!attribute [r] starttime
14
+ # @return [String]
15
+ attribute? :starttime, Types::String.optional
16
+
17
+ # @!attribute [r] endtime
18
+ # @return [String]
19
+ attribute? :endtime, Types::String.optional
20
+ end
21
+
22
+ # @!attribute [r] online_message
23
+ # @return [String]
24
+ attribute? :online_message, Types::String.optional
25
+
26
+ # @!attribute [r] offline_message
27
+ # @return [String]
28
+ attribute? :offline_message, Types::String.optional
29
+
30
+ # @!attribute [r] timezone
31
+ # @return [String]
32
+ attribute? :timezone, Types::String.optional
33
+
34
+ # @!attribute [r] send_online_if_resolved
35
+ # @return [TrueClass,FalseClass]
36
+ attribute? :send_online_if_resolved, Types::Bool.optional
37
+
38
+ # @!attribute [r] send_offline_each_message
39
+ # @return [TrueClass,FalseClass]
40
+ attribute? :send_offline_each_message, Types::Bool.optional
41
+
42
+ # @!attribute [r] office_hours
43
+ # @return [Array<Qismo::Objects::OfficeHour::OfficeHourElement>]
44
+ attribute? :office_hours, Types.Array(OfficeHourElement.optional).optional
45
+
46
+ def in_office_hour?
47
+ return false if timezone.blank?
48
+
49
+ offset = ::Time.zone_offset(timezone)
50
+ tz_current = ::Time.current.getlocal(offset)
51
+
52
+ today_office_hour = office_hours.find { |oh| oh.day == tz_current.strftime("%u").to_i }
53
+ return false if today_office_hour.nil?
54
+
55
+ start_hour = today_office_hour.starttime
56
+ end_hour = today_office_hour.endtime
57
+
58
+ # rubocop:disable Layout/LineLength
59
+ start_time = ::Time.parse("#{tz_current.year}-#{tz_current.month}-#{tz_current.day} #{start_hour} #{timezone}")
60
+ end_time = ::Time.parse("#{tz_current.year}-#{tz_current.month}-#{tz_current.day} #{end_hour} #{timezone}")
61
+ # rubocop:enable Layout/LineLength
62
+
63
+ tz_current.between?(start_time, end_time)
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,27 @@
1
+ module Qismo
2
+ module Objects
3
+ # Qiscus channel object
4
+ #
5
+ class QiscusChannel < Qismo::Object
6
+ # @!attribute [r] id
7
+ # @return [Integer]
8
+ attribute? :id, Types::Int.optional
9
+
10
+ # @!attribute [r] is_active
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :is_active, Types::Bool.optional
13
+
14
+ # @!attribute [r] name
15
+ # @return [String]
16
+ attribute? :name, Types::String.optional
17
+
18
+ # @!attribute [r] badge_url
19
+ # @return [String]
20
+ attribute? :badge_url, Types::String.optional
21
+
22
+ # @!attribute [r] use_channel_responder
23
+ # @return [TrueClass,FalseClass]
24
+ attribute? :use_channel_responder, Types::Bool.optional
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,15 @@
1
+ module Qismo
2
+ module Objects
3
+ # Room additional info object
4
+ #
5
+ class RoomAdditionalInfo < Qismo::Object
6
+ # @!attribute [r] key
7
+ # @return [String]
8
+ attribute? :key, Types::String.optional
9
+
10
+ # @!attribute [r] value
11
+ # @return [String,Integer,TrueClass,FalseClass]
12
+ attribute? :value, (Types::String.optional | Types::Int.optional | Types::Params::Bool.optional)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ module Qismo
2
+ module Objects
3
+ # Tag object
4
+ #
5
+ class Tag < Qismo::Object
6
+ # @!attribute [r] created_at
7
+ # @return [String]
8
+ attribute? :created_at, Types::String.optional
9
+
10
+ # @!attribute [r] id
11
+ # @return [Integer]
12
+ attribute? :id, Types::Int.optional
13
+
14
+ # @!attribute [r] name
15
+ # @return [String]
16
+ attribute? :name, Types::String.optional
17
+
18
+ # @!attribute [r] room_tag_created_at
19
+ # @return [String]
20
+ attribute? :room_tag_created, Types::String.optional
21
+
22
+ # @!attribute [r] updated_at
23
+ # @return [String]
24
+ attribute? :updated_at, Types::String.optional
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ module Qismo
2
+ module Objects
3
+ # Telegram channel object
4
+ #
5
+ class TelegramChannel < Qismo::Object
6
+ # @!attribute [r] id
7
+ # @return [Integer]
8
+ attribute? :id, Types::Int.optional
9
+
10
+ # @!attribute [r] is_active
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :is_active, Types::Bool.optional
13
+
14
+ # @!attribute [r] name
15
+ # @return [String]
16
+ attribute? :name, Types::String.optional
17
+
18
+ # @!attribute [r] username
19
+ # @return [String]
20
+ attribute? :username, Types::String.optional
21
+
22
+ # @!attribute [r] badge_url
23
+ # @return [String]
24
+ attribute? :badge_url, Types::String.optional
25
+
26
+ # @!attribute [r] use_channel_responder
27
+ # @return [TrueClass,FalseClass]
28
+ attribute? :use_channel_responder, Types::Bool.optional
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,99 @@
1
+ module Qismo
2
+ module Objects
3
+ # User object
4
+ #
5
+ class User < Qismo::Object
6
+ # User channel object
7
+ #
8
+ class Channel < Qismo::Object
9
+ # @!attribute [r] id
10
+ # @return [Integer]
11
+ attribute? :id, Types::Int.optional
12
+
13
+ # @!attribute [r] name
14
+ # @return [String]
15
+ attribute? :name, Types::String.optional
16
+ end
17
+
18
+ # User role object
19
+ #
20
+ class Role < Qismo::Object
21
+ # @!attribute [r] id
22
+ # @return [Integer]
23
+ attribute? :id, Types::Int.optional
24
+
25
+ # @!attribute [r] name
26
+ # @return [String]
27
+ attribute? :name, Types::String.optional
28
+ end
29
+
30
+ # @!attribute [r] user_channels
31
+ # @return [Array<Qismo::Objects::User::Channel>]
32
+ attribute? :user_channels, Types.Array(Channel.optional).optional
33
+
34
+ # @!attribute [r] user_roles
35
+ # @return [Array<Qismo::Objects::User::Role>]
36
+ attribute? :user_roles, Types.Array(Role.optional).optional
37
+
38
+ # @!attribute [r] avatar_url
39
+ # @return [String]
40
+ attribute? :avatar_url, Types::String.optional
41
+
42
+ # @!attribute [r] created_at
43
+ # @return [String]
44
+ attribute? :created_at, Types::String.optional
45
+
46
+ # @!attribute [r] email
47
+ # @return [String]
48
+ attribute? :email, Types::String.optional
49
+
50
+ # @!attribute [r] force_offline
51
+ # @return [TrueClass,FalseClass]
52
+ attribute? :force_offline, Types::Bool.optional
53
+
54
+ # @!attribute [r] id
55
+ # @return [Integer]
56
+ attribute? :id, Types::Int.optional
57
+
58
+ # @!attribute [r] is_available
59
+ # @return [TrueClass,FalseClass]
60
+ attribute? :is_available, Types::Bool.optional
61
+
62
+ # @!attribute [r] is_verified
63
+ # @return [TrueClass,FalseClass]
64
+ attribute? :is_verified, Types::Bool.optional
65
+
66
+ # @!attribute [r] last_login
67
+ # @return [String]
68
+ attribute? :last_login, Types::String.optional
69
+
70
+ # @!attribute [r] name
71
+ # @return [String]
72
+ attribute? :name, Types::String.optional
73
+
74
+ # @!attribute [r] sdk_email
75
+ # @return [String]
76
+ attribute? :sdk_email, Types::String.optional
77
+
78
+ # @!attribute [r] sdk_key
79
+ # @return [String]
80
+ attribute? :sdk_key, Types::String.optional
81
+
82
+ # @!attribute [r] type
83
+ # @return [String]
84
+ attribute? :type, Types::Int.optional
85
+
86
+ # @!attribute [r] type_as_string
87
+ # @return [String]
88
+ attribute? :type_as_string, Types::String.optional
89
+
90
+ # @!attribute [r] updated_at
91
+ # @return [String]
92
+ attribute? :updated_at, Types::String.optional
93
+
94
+ # @!attribute [r] current_customer_count
95
+ # @return [Integer]
96
+ attribute? :current_customer_count, Types::Int.optional
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,111 @@
1
+ module Qismo
2
+ module Objects
3
+ # WA channel object
4
+ #
5
+ class WaChannel < Qismo::Object
6
+ # @!attribute [r] allow_intl_hsm
7
+ # @return [TrueClass,FalseClass]
8
+ attribute? :allow_intl_hsm, Types::Bool.optional
9
+
10
+ # @!attribute [r] alter_app_id
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :alter_app_id, Types::Bool.optional
13
+
14
+ # @!attribute [r] badge_url
15
+ # @return [String]
16
+ attribute? :badge_url, Types::String.optional
17
+
18
+ # @!attribute [r] base_url
19
+ # @return [String]
20
+ attribute? :base_url, Types::String.optional
21
+
22
+ # @!attribute [r] business_id
23
+ # @return [String]
24
+ attribute? :business_id, Types::String.optional
25
+
26
+ # @!attribute [r] business_verification_status
27
+ # @return [String]
28
+ attribute? :business_verification_status, Types::String.optional
29
+
30
+ # @!attribute [r] created_at
31
+ # @return [String]
32
+ attribute? :created_at, Types::String.optional
33
+
34
+ # @!attribute [r] forward_enabled
35
+ # @return [TrueClass,FalseClass]
36
+ attribute? :forward_enabled, Types::Bool.optional
37
+
38
+ # @!attribute [r] forward_url
39
+ # @return [String]
40
+ attribute? :forward_url, Types::String.optional
41
+
42
+ # @!attribute [r] hsm_24_enabled
43
+ # @return [TrueClass,FalseClass]
44
+ attribute? :hsm_24_enabled, Types::Bool.optional
45
+
46
+ # @!attribute [r] id
47
+ # @return [Integer]
48
+ attribute? :id, Types::Int.optional
49
+
50
+ # @!attribute [r] is_active
51
+ # @return [TrueClass,FalseClass]
52
+ attribute? :is_active, Types::Bool.optional
53
+
54
+ # @!attribute [r] is_auto_responder_enabled
55
+ # @return [TrueClass,FalseClass]
56
+ attribute? :is_auto_responder_enabled, Types::Bool.optional
57
+
58
+ # @!attribute [r] is_bot_enabled
59
+ # @return [TrueClass,FalseClass]
60
+ attribute? :is_bot_enabled, Types::Bool.optional
61
+
62
+ # @!attribute [r] is_on_cloud
63
+ # @return [TrueClass,FalseClass]
64
+ attribute? :is_on_cloud, Types::Bool.optional
65
+
66
+ # @!attribute [r] is_ssl_enabled
67
+ # @return [TrueClass,FalseClass]
68
+ attribute? :is_ssl_enabled, Types::Bool.optional
69
+
70
+ # @!attribute [r] name
71
+ # @return [String]
72
+ attribute? :name, Types::String.optional
73
+
74
+ # @!attribute [r] on_sync
75
+ # @return [TrueClass,FalseClass]
76
+ attribute? :on_sync, Types::Bool.optional
77
+
78
+ # @!attribute [r] phone_number
79
+ # @return [String]
80
+ attribute? :phone_number, Types::String.optional
81
+
82
+ # @!attribute [r] phone_number_id
83
+ # @return [String]
84
+ attribute? :phone_number_id, Types::String.optional
85
+
86
+ # @!attribute [r] phone_number_status
87
+ # @return [String]
88
+ attribute? :phone_number_status, Types::String.optional
89
+
90
+ # @!attribute [r] pin
91
+ # @return [String]
92
+ attribute? :pin, Types::String.optional
93
+
94
+ # @!attribute [r] platform
95
+ # @return [String]
96
+ attribute? :platform, Types::String.optional
97
+
98
+ # @!attribute [r] read_enabled
99
+ # @return [TrueClass,FalseClass]
100
+ attribute? :read_enabled, Types::Bool.optional
101
+
102
+ # @!attribute [r] updated_at
103
+ # @return [String]
104
+ attribute? :updated_at, Types::String.optional
105
+
106
+ # @!attribute [r] use_channel_responder
107
+ # @return [TrueClass,FalseClass]
108
+ attribute? :use_channel_responder, Types::Bool.optional
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,71 @@
1
+ module Qismo
2
+ module Objects
3
+ # WA credit info object
4
+ #
5
+ class WaCreditInfo < Qismo::Object
6
+ # Wa credit info channel object
7
+ #
8
+ class Channel < Qismo::Object
9
+ # WA last payment object
10
+ #
11
+ class LastPayment < Qismo::Object
12
+ # @!attribute [r] credit
13
+ # @return [String]
14
+ attribute? :credit, Types::String.optional
15
+
16
+ # @!attribute [r] due_date
17
+ # @return [String]
18
+ attribute? :due_date, Types::String.optional
19
+
20
+ # @!attribute [r] id
21
+ # @return [Integer]
22
+ attribute? :id, Types::Int.optional
23
+
24
+ # @!attribute [r] issued_date
25
+ # @return [String]
26
+ attribute? :issued_date, Types::String.optional
27
+
28
+ # @!attribute [r] status
29
+ # @return [Integer]
30
+ attribute? :status, Types::Int.optional
31
+
32
+ # @!attribute [r] status_string
33
+ # @return [String]
34
+ attribute? :status_string, Types::String.optional
35
+
36
+ # @!attribute [r] updated_at
37
+ # @return [String]
38
+ attribute? :updated_at, Types::String.optional
39
+ end
40
+
41
+ # @!attribute [r] balance
42
+ # @return [Integer]
43
+ attribute? :balance, Types::Int.optional
44
+
45
+ # @!attribute [r] id
46
+ # @return [Integer]
47
+ attribute? :id, Types::Int.optional
48
+
49
+ # @!attribute [r] is_bsp_qiscus
50
+ # @return [TrueClass,FalseClass]
51
+ attribute? :is_bsp_qiscus, Types::Bool.optional
52
+
53
+ # @!attribute [r] last_payment
54
+ # @return [Qismo::Objects::WaCreditInfo::Channel]
55
+ attribute? :last_payment, LastPayment.optional
56
+
57
+ # @!attribute [r] name
58
+ # @return [String]
59
+ attribute? :name, Types::String.optional
60
+ end
61
+
62
+ # @!attribute [r] channels
63
+ # @return [Array<Qismo::Objects::WaCreditInfo::Channel>]
64
+ attribute? :channels, Types.Array(Channel.optional).optional
65
+
66
+ # @!attribute [r] free_sessions
67
+ # @return [Integer]
68
+ attribute? :free_sessions, Types::Int.optional
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,55 @@
1
+ module Qismo
2
+ module Objects
3
+ # Waca channel object
4
+ #
5
+ class WacaChannel < Qismo::Object
6
+ # @!attribute [r] badge_url
7
+ # @return [String]
8
+ attribute? :badge_url, Types::String.optional
9
+
10
+ # @!attribute [r] business_id
11
+ # @return [String]
12
+ attribute? :business_id, Types::String.optional
13
+
14
+ # @!attribute [r] created_at
15
+ # @return [String]
16
+ attribute? :created_at, Types::String.optional
17
+
18
+ # @!attribute [r] updated_at
19
+ # @return [String]
20
+ attribute? :deleted_at, Types::Nil.optional
21
+
22
+ # @!attribute [r] id
23
+ # @return [Integer]
24
+ attribute? :id, Types::Int.optional
25
+
26
+ # @!attribute [r] is_active
27
+ # @return [TrueClass,FalseClass]
28
+ attribute? :is_active, Types::Bool.optional
29
+
30
+ # @!attribute [r] name
31
+ # @return [String]
32
+ attribute? :name, Types::String.optional
33
+
34
+ # @!attribute [r] phone_number
35
+ # @return [String]
36
+ attribute? :phone_number, Types::String.optional
37
+
38
+ # @!attribute [r] phone_number_id
39
+ # @return [String]
40
+ attribute? :phone_number_id, Types::String.optional
41
+
42
+ # @!attribute [r] updated_at
43
+ # @return [String]
44
+ attribute? :updated_at, Types::String.optional
45
+
46
+ # @!attribute [r] use_channel_responder
47
+ # @return [TrueClass,FalseClass]
48
+ attribute? :use_channel_responder, Types::Bool.optional
49
+
50
+ # @!attribute [r] webhook_identifier
51
+ # @return [String]
52
+ attribute? :webhook_identifier, Types::String.optional
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,15 @@
1
+ module Qismo
2
+ module Objects
3
+ # Webhook object
4
+ #
5
+ class Webhook < Qismo::Object
6
+ # @!attribute [r] url
7
+ # @return [String]
8
+ attribute? :url, Types::String.optional
9
+
10
+ # @!attribute [r] enabled
11
+ # @return [TrueClass,FalseClass]
12
+ attribute? :enabled, Types::Bool.optional
13
+ end
14
+ end
15
+ end
data/lib/qismo/types.rb CHANGED
@@ -1,10 +1,19 @@
1
1
  module Qismo
2
+ # Type specs module. Inherited from dry-types
3
+ #
2
4
  module Types
3
5
  include Dry.Types()
4
6
 
7
+ # @return [Integer]
5
8
  Int = Params::Integer
6
- String = Params::String
9
+
10
+ # @return [String]
11
+ String = Coercible::String
12
+
13
+ # @return [TrueClass,FalseClass]
7
14
  Bool = Params::Bool
15
+
16
+ # @return [Hash]
8
17
  Hash = Params::Hash
9
18
  end
10
19
  end
data/lib/qismo/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Qismo
4
4
  # @return [String]
5
- VERSION = "0.13.0"
5
+ VERSION = "0.15.0"
6
6
  end
@@ -1,6 +1,12 @@
1
1
  module Qismo
2
+ # Objects module to handle objectification of incoming webhook request
3
+ #
2
4
  module WebhookRequests
3
- class OnAgentAllocationNeeded < Qismo::Models::Base
5
+ # CAA webhook object
6
+ #
7
+ class OnAgentAllocationNeeded < Qismo::Object
8
+ # Candidate agent object
9
+ #
4
10
  # @!attribute [r] avatar_url
5
11
  # @return [String]
6
12
  # @!attribute [r] created_at
@@ -25,7 +31,7 @@ module Qismo
25
31
  # @return [String]
26
32
  # @!attribute [r] updated_at
27
33
  # @return [String]
28
- class CandidateAgent < Qismo::Models::Base
34
+ class CandidateAgent < Qismo::Object
29
35
  attribute? :avatar_url, Types::String.optional
30
36
  attribute? :created_at, Types::String.optional
31
37
  attribute? :email, Types::String.optional