trycourier 4.4.0 → 4.5.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.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/trycourier/internal/transport/pooled_net_requester.rb +12 -10
  5. data/lib/trycourier/internal/type/base_model.rb +4 -3
  6. data/lib/trycourier/internal/type/union.rb +7 -9
  7. data/lib/trycourier/internal/util.rb +7 -2
  8. data/lib/trycourier/models/airship_profile.rb +21 -0
  9. data/lib/trycourier/models/airship_profile_audience.rb +15 -0
  10. data/lib/trycourier/models/audience.rb +3 -3
  11. data/lib/trycourier/models/audience_filter.rb +52 -0
  12. data/lib/trycourier/models/audience_recipient.rb +36 -0
  13. data/lib/trycourier/models/audience_update_params.rb +3 -3
  14. data/lib/trycourier/models/device_type.rb +7 -0
  15. data/lib/trycourier/models/discord.rb +16 -0
  16. data/lib/trycourier/models/expo.rb +16 -0
  17. data/lib/trycourier/models/filter.rb +8 -51
  18. data/lib/trycourier/models/filter_config.rb +8 -51
  19. data/lib/trycourier/models/intercom.rb +21 -0
  20. data/lib/trycourier/models/intercom_recipient.rb +15 -0
  21. data/lib/trycourier/models/list_filter.rb +52 -0
  22. data/lib/trycourier/models/list_pattern_recipient.rb +23 -0
  23. data/lib/trycourier/models/list_recipient.rb +29 -0
  24. data/lib/trycourier/models/ms_teams.rb +22 -0
  25. data/lib/trycourier/models/ms_teams_base_properties.rb +21 -0
  26. data/lib/trycourier/models/ms_teams_recipient.rb +17 -0
  27. data/lib/trycourier/models/multiple_tokens.rb +15 -0
  28. data/lib/trycourier/models/nested_filter_config.rb +49 -0
  29. data/lib/trycourier/models/pagerduty.rb +33 -0
  30. data/lib/trycourier/models/pagerduty_recipient.rb +17 -0
  31. data/lib/trycourier/models/send_direct_message.rb +15 -0
  32. data/lib/trycourier/models/send_message_params.rb +24 -7
  33. data/lib/trycourier/models/send_to_channel.rb +15 -0
  34. data/lib/trycourier/models/send_to_ms_teams_channel_id.rb +27 -0
  35. data/lib/trycourier/models/send_to_ms_teams_channel_name.rb +33 -0
  36. data/lib/trycourier/models/send_to_ms_teams_conversation_id.rb +27 -0
  37. data/lib/trycourier/models/send_to_ms_teams_email.rb +27 -0
  38. data/lib/trycourier/models/send_to_ms_teams_user_id.rb +27 -0
  39. data/lib/trycourier/models/send_to_slack_channel.rb +21 -0
  40. data/lib/trycourier/models/send_to_slack_email.rb +21 -0
  41. data/lib/trycourier/models/send_to_slack_user_id.rb +21 -0
  42. data/lib/trycourier/models/single_filter_config.rb +62 -0
  43. data/lib/trycourier/models/slack.rb +18 -0
  44. data/lib/trycourier/models/slack_base_properties.rb +15 -0
  45. data/lib/trycourier/models/slack_recipient.rb +17 -0
  46. data/lib/trycourier/models/token.rb +15 -0
  47. data/lib/trycourier/models/user_profile.rb +274 -0
  48. data/lib/trycourier/models/user_profile_firebase_token.rb +19 -0
  49. data/lib/trycourier/models/webhook_auth_mode.rb +16 -0
  50. data/lib/trycourier/models/webhook_authentication.rb +40 -0
  51. data/lib/trycourier/models/webhook_method.rb +15 -0
  52. data/lib/trycourier/models/webhook_profile.rb +53 -0
  53. data/lib/trycourier/models/webhook_profile_type.rb +15 -0
  54. data/lib/trycourier/models/webhook_recipient.rb +17 -0
  55. data/lib/trycourier/models.rb +84 -2
  56. data/lib/trycourier/resources/audiences.rb +1 -1
  57. data/lib/trycourier/version.rb +1 -1
  58. data/lib/trycourier.rb +42 -1
  59. data/rbi/trycourier/models/airship_profile.rbi +41 -0
  60. data/rbi/trycourier/models/airship_profile_audience.rbi +26 -0
  61. data/rbi/trycourier/models/audience.rbi +8 -7
  62. data/rbi/trycourier/models/audience_filter.rbi +88 -0
  63. data/rbi/trycourier/models/audience_recipient.rbi +52 -0
  64. data/rbi/trycourier/models/audience_update_params.rbi +25 -7
  65. data/rbi/trycourier/models/device_type.rbi +7 -0
  66. data/rbi/trycourier/models/discord.rbi +18 -0
  67. data/rbi/trycourier/models/expo.rbi +16 -0
  68. data/rbi/trycourier/models/filter.rbi +8 -78
  69. data/rbi/trycourier/models/filter_config.rbi +8 -83
  70. data/rbi/trycourier/models/intercom.rbi +35 -0
  71. data/rbi/trycourier/models/intercom_recipient.rbi +23 -0
  72. data/rbi/trycourier/models/list_filter.rbi +86 -0
  73. data/rbi/trycourier/models/list_pattern_recipient.rbi +39 -0
  74. data/rbi/trycourier/models/list_recipient.rbi +44 -0
  75. data/rbi/trycourier/models/ms_teams.rbi +24 -0
  76. data/rbi/trycourier/models/ms_teams_base_properties.rbi +31 -0
  77. data/rbi/trycourier/models/ms_teams_recipient.rbi +58 -0
  78. data/rbi/trycourier/models/multiple_tokens.rbi +27 -0
  79. data/rbi/trycourier/models/nested_filter_config.rbi +104 -0
  80. data/rbi/trycourier/models/pagerduty.rbi +53 -0
  81. data/rbi/trycourier/models/pagerduty_recipient.rbi +31 -0
  82. data/rbi/trycourier/models/send_direct_message.rbi +23 -0
  83. data/rbi/trycourier/models/send_message_params.rbi +34 -10
  84. data/rbi/trycourier/models/send_to_channel.rbi +23 -0
  85. data/rbi/trycourier/models/send_to_ms_teams_channel_id.rbi +42 -0
  86. data/rbi/trycourier/models/send_to_ms_teams_channel_name.rbi +51 -0
  87. data/rbi/trycourier/models/send_to_ms_teams_conversation_id.rbi +42 -0
  88. data/rbi/trycourier/models/send_to_ms_teams_email.rbi +37 -0
  89. data/rbi/trycourier/models/send_to_ms_teams_user_id.rbi +37 -0
  90. data/rbi/trycourier/models/send_to_slack_channel.rbi +28 -0
  91. data/rbi/trycourier/models/send_to_slack_email.rbi +28 -0
  92. data/rbi/trycourier/models/send_to_slack_user_id.rbi +28 -0
  93. data/rbi/trycourier/models/single_filter_config.rbi +116 -0
  94. data/rbi/trycourier/models/slack.rbi +22 -0
  95. data/rbi/trycourier/models/slack_base_properties.rbi +23 -0
  96. data/rbi/trycourier/models/slack_recipient.rbi +52 -0
  97. data/rbi/trycourier/models/token.rbi +21 -0
  98. data/rbi/trycourier/models/user_profile.rbi +377 -0
  99. data/rbi/trycourier/models/user_profile_firebase_token.rbi +25 -0
  100. data/rbi/trycourier/models/webhook_auth_mode.rbi +22 -0
  101. data/rbi/trycourier/models/webhook_authentication.rbi +64 -0
  102. data/rbi/trycourier/models/webhook_method.rbi +21 -0
  103. data/rbi/trycourier/models/webhook_profile.rbi +80 -0
  104. data/rbi/trycourier/models/webhook_profile_type.rbi +22 -0
  105. data/rbi/trycourier/models/webhook_recipient.rbi +31 -0
  106. data/rbi/trycourier/models.rbi +84 -2
  107. data/rbi/trycourier/resources/audiences.rbi +7 -1
  108. data/sig/trycourier/models/airship_profile.rbs +25 -0
  109. data/sig/trycourier/models/airship_profile_audience.rbs +13 -0
  110. data/sig/trycourier/models/audience.rbs +4 -4
  111. data/sig/trycourier/models/audience_filter.rbs +50 -0
  112. data/sig/trycourier/models/audience_recipient.rbs +30 -0
  113. data/sig/trycourier/models/audience_update_params.rbs +8 -4
  114. data/sig/trycourier/models/device_type.rbs +5 -0
  115. data/sig/trycourier/models/discord.rbs +11 -0
  116. data/sig/trycourier/models/expo.rbs +11 -0
  117. data/sig/trycourier/models/filter.rbs +4 -61
  118. data/sig/trycourier/models/filter_config.rbs +4 -61
  119. data/sig/trycourier/models/intercom.rbs +15 -0
  120. data/sig/trycourier/models/intercom_recipient.rbs +13 -0
  121. data/sig/trycourier/models/list_filter.rbs +50 -0
  122. data/sig/trycourier/models/list_pattern_recipient.rbs +19 -0
  123. data/sig/trycourier/models/list_recipient.rbs +30 -0
  124. data/sig/trycourier/models/ms_teams.rbs +16 -0
  125. data/sig/trycourier/models/ms_teams_base_properties.rbs +15 -0
  126. data/sig/trycourier/models/ms_teams_recipient.rbs +13 -0
  127. data/sig/trycourier/models/multiple_tokens.rbs +13 -0
  128. data/sig/trycourier/models/nested_filter_config.rbs +64 -0
  129. data/sig/trycourier/models/pagerduty.rbs +35 -0
  130. data/sig/trycourier/models/pagerduty_recipient.rbs +13 -0
  131. data/sig/trycourier/models/send_direct_message.rbs +13 -0
  132. data/sig/trycourier/models/send_message_params.rbs +9 -3
  133. data/sig/trycourier/models/send_to_channel.rbs +13 -0
  134. data/sig/trycourier/models/send_to_ms_teams_channel_id.rbs +26 -0
  135. data/sig/trycourier/models/send_to_ms_teams_channel_name.rbs +35 -0
  136. data/sig/trycourier/models/send_to_ms_teams_conversation_id.rbs +26 -0
  137. data/sig/trycourier/models/send_to_ms_teams_email.rbs +22 -0
  138. data/sig/trycourier/models/send_to_ms_teams_user_id.rbs +26 -0
  139. data/sig/trycourier/models/send_to_slack_channel.rbs +15 -0
  140. data/sig/trycourier/models/send_to_slack_email.rbs +15 -0
  141. data/sig/trycourier/models/send_to_slack_user_id.rbs +15 -0
  142. data/sig/trycourier/models/single_filter_config.rbs +69 -0
  143. data/sig/trycourier/models/slack.rbs +14 -0
  144. data/sig/trycourier/models/slack_base_properties.rbs +13 -0
  145. data/sig/trycourier/models/slack_recipient.rbs +13 -0
  146. data/sig/trycourier/models/token.rbs +13 -0
  147. data/sig/trycourier/models/user_profile.rbs +212 -0
  148. data/sig/trycourier/models/user_profile_firebase_token.rbs +13 -0
  149. data/sig/trycourier/models/webhook_auth_mode.rbs +15 -0
  150. data/sig/trycourier/models/webhook_authentication.rbs +35 -0
  151. data/sig/trycourier/models/webhook_method.rbs +14 -0
  152. data/sig/trycourier/models/webhook_profile.rbs +40 -0
  153. data/sig/trycourier/models/webhook_profile_type.rbs +14 -0
  154. data/sig/trycourier/models/webhook_recipient.rbs +13 -0
  155. data/sig/trycourier/models.rbs +86 -4
  156. data/sig/trycourier/resources/audiences.rbs +1 -1
  157. metadata +128 -5
  158. data/lib/trycourier/models/recipient.rb +0 -113
  159. data/rbi/trycourier/models/recipient.rbi +0 -161
  160. data/sig/trycourier/models/recipient.rbs +0 -92
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class Intercom < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::Intercom, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :from
13
+
14
+ sig { returns(Trycourier::IntercomRecipient) }
15
+ attr_reader :to
16
+
17
+ sig { params(to: Trycourier::IntercomRecipient::OrHash).void }
18
+ attr_writer :to
19
+
20
+ sig do
21
+ params(from: String, to: Trycourier::IntercomRecipient::OrHash).returns(
22
+ T.attached_class
23
+ )
24
+ end
25
+ def self.new(from:, to:)
26
+ end
27
+
28
+ sig do
29
+ override.returns({ from: String, to: Trycourier::IntercomRecipient })
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class IntercomRecipient < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::IntercomRecipient, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :id
13
+
14
+ sig { params(id: String).returns(T.attached_class) }
15
+ def self.new(id:)
16
+ end
17
+
18
+ sig { override.returns({ id: String }) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,86 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListFilter < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::ListFilter, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ # Send to users only if they are member of the account
12
+ sig { returns(Trycourier::ListFilter::Operator::OrSymbol) }
13
+ attr_accessor :operator
14
+
15
+ sig { returns(Trycourier::ListFilter::Path::OrSymbol) }
16
+ attr_accessor :path
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :value
20
+
21
+ sig do
22
+ params(
23
+ operator: Trycourier::ListFilter::Operator::OrSymbol,
24
+ path: Trycourier::ListFilter::Path::OrSymbol,
25
+ value: String
26
+ ).returns(T.attached_class)
27
+ end
28
+ def self.new(
29
+ # Send to users only if they are member of the account
30
+ operator:,
31
+ path:,
32
+ value:
33
+ )
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ {
39
+ operator: Trycourier::ListFilter::Operator::OrSymbol,
40
+ path: Trycourier::ListFilter::Path::OrSymbol,
41
+ value: String
42
+ }
43
+ )
44
+ end
45
+ def to_hash
46
+ end
47
+
48
+ # Send to users only if they are member of the account
49
+ module Operator
50
+ extend Trycourier::Internal::Type::Enum
51
+
52
+ TaggedSymbol =
53
+ T.type_alias { T.all(Symbol, Trycourier::ListFilter::Operator) }
54
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
55
+
56
+ MEMBER_OF =
57
+ T.let(:MEMBER_OF, Trycourier::ListFilter::Operator::TaggedSymbol)
58
+
59
+ sig do
60
+ override.returns(
61
+ T::Array[Trycourier::ListFilter::Operator::TaggedSymbol]
62
+ )
63
+ end
64
+ def self.values
65
+ end
66
+ end
67
+
68
+ module Path
69
+ extend Trycourier::Internal::Type::Enum
70
+
71
+ TaggedSymbol =
72
+ T.type_alias { T.all(Symbol, Trycourier::ListFilter::Path) }
73
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
74
+
75
+ ACCOUNT_ID =
76
+ T.let(:account_id, Trycourier::ListFilter::Path::TaggedSymbol)
77
+
78
+ sig do
79
+ override.returns(T::Array[Trycourier::ListFilter::Path::TaggedSymbol])
80
+ end
81
+ def self.values
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,39 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListPatternRecipient < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::ListPatternRecipient, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
12
+ attr_accessor :data
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :list_pattern
16
+
17
+ # Send to users in lists matching a pattern
18
+ sig do
19
+ params(
20
+ data: T.nilable(T::Hash[Symbol, T.anything]),
21
+ list_pattern: T.nilable(String)
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(data: nil, list_pattern: nil)
25
+ end
26
+
27
+ sig do
28
+ override.returns(
29
+ {
30
+ data: T.nilable(T::Hash[Symbol, T.anything]),
31
+ list_pattern: T.nilable(String)
32
+ }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,44 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListRecipient < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::ListRecipient, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
12
+ attr_accessor :data
13
+
14
+ sig { returns(T.nilable(T::Array[Trycourier::ListFilter])) }
15
+ attr_accessor :filters
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :list_id
19
+
20
+ # Send to all users in a specific list
21
+ sig do
22
+ params(
23
+ data: T.nilable(T::Hash[Symbol, T.anything]),
24
+ filters: T.nilable(T::Array[Trycourier::ListFilter::OrHash]),
25
+ list_id: T.nilable(String)
26
+ ).returns(T.attached_class)
27
+ end
28
+ def self.new(data: nil, filters: nil, list_id: nil)
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ {
34
+ data: T.nilable(T::Hash[Symbol, T.anything]),
35
+ filters: T.nilable(T::Array[Trycourier::ListFilter]),
36
+ list_id: T.nilable(String)
37
+ }
38
+ )
39
+ end
40
+ def to_hash
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,24 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ module MsTeams
6
+ extend Trycourier::Internal::Type::Union
7
+
8
+ Variants =
9
+ T.type_alias do
10
+ T.any(
11
+ Trycourier::SendToMsTeamsUserID,
12
+ Trycourier::SendToMsTeamsEmail,
13
+ Trycourier::SendToMsTeamsChannelID,
14
+ Trycourier::SendToMsTeamsConversationID,
15
+ Trycourier::SendToMsTeamsChannelName
16
+ )
17
+ end
18
+
19
+ sig { override.returns(T::Array[Trycourier::MsTeams::Variants]) }
20
+ def self.variants
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MsTeamsBaseProperties < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Trycourier::MsTeamsBaseProperties,
10
+ Trycourier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :service_url
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :tenant_id
19
+
20
+ sig do
21
+ params(service_url: String, tenant_id: String).returns(T.attached_class)
22
+ end
23
+ def self.new(service_url:, tenant_id:)
24
+ end
25
+
26
+ sig { override.returns({ service_url: String, tenant_id: String }) }
27
+ def to_hash
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MsTeamsRecipient < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::MsTeamsRecipient, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig do
12
+ returns(
13
+ T.any(
14
+ Trycourier::SendToMsTeamsUserID,
15
+ Trycourier::SendToMsTeamsEmail,
16
+ Trycourier::SendToMsTeamsChannelID,
17
+ Trycourier::SendToMsTeamsConversationID,
18
+ Trycourier::SendToMsTeamsChannelName
19
+ )
20
+ )
21
+ end
22
+ attr_accessor :ms_teams
23
+
24
+ # Send via Microsoft Teams
25
+ sig do
26
+ params(
27
+ ms_teams:
28
+ T.any(
29
+ Trycourier::SendToMsTeamsUserID::OrHash,
30
+ Trycourier::SendToMsTeamsEmail::OrHash,
31
+ Trycourier::SendToMsTeamsChannelID::OrHash,
32
+ Trycourier::SendToMsTeamsConversationID::OrHash,
33
+ Trycourier::SendToMsTeamsChannelName::OrHash
34
+ )
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(ms_teams:)
38
+ end
39
+
40
+ sig do
41
+ override.returns(
42
+ {
43
+ ms_teams:
44
+ T.any(
45
+ Trycourier::SendToMsTeamsUserID,
46
+ Trycourier::SendToMsTeamsEmail,
47
+ Trycourier::SendToMsTeamsChannelID,
48
+ Trycourier::SendToMsTeamsConversationID,
49
+ Trycourier::SendToMsTeamsChannelName
50
+ )
51
+ }
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MultipleTokens < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::MultipleTokens, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T::Array[Trycourier::Token]) }
12
+ attr_accessor :tokens
13
+
14
+ sig do
15
+ params(tokens: T::Array[Trycourier::Token::OrHash]).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(tokens:)
20
+ end
21
+
22
+ sig { override.returns({ tokens: T::Array[Trycourier::Token] }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,104 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class NestedFilterConfig < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::NestedFilterConfig, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ # The operator to use for filtering
12
+ sig { returns(Trycourier::NestedFilterConfig::Operator::OrSymbol) }
13
+ attr_accessor :operator
14
+
15
+ sig { returns(T::Array[Trycourier::FilterConfig]) }
16
+ attr_accessor :rules
17
+
18
+ sig do
19
+ params(
20
+ operator: Trycourier::NestedFilterConfig::Operator::OrSymbol,
21
+ rules: T::Array[Trycourier::FilterConfig]
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # The operator to use for filtering
26
+ operator:,
27
+ rules:
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ {
34
+ operator: Trycourier::NestedFilterConfig::Operator::OrSymbol,
35
+ rules: T::Array[Trycourier::FilterConfig]
36
+ }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+
42
+ # The operator to use for filtering
43
+ module Operator
44
+ extend Trycourier::Internal::Type::Enum
45
+
46
+ TaggedSymbol =
47
+ T.type_alias do
48
+ T.all(Symbol, Trycourier::NestedFilterConfig::Operator)
49
+ end
50
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
51
+
52
+ ENDS_WITH =
53
+ T.let(
54
+ :ENDS_WITH,
55
+ Trycourier::NestedFilterConfig::Operator::TaggedSymbol
56
+ )
57
+ EQ = T.let(:EQ, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
58
+ EXISTS =
59
+ T.let(:EXISTS, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
60
+ GT = T.let(:GT, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
61
+ GTE =
62
+ T.let(:GTE, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
63
+ INCLUDES =
64
+ T.let(
65
+ :INCLUDES,
66
+ Trycourier::NestedFilterConfig::Operator::TaggedSymbol
67
+ )
68
+ IS_AFTER =
69
+ T.let(
70
+ :IS_AFTER,
71
+ Trycourier::NestedFilterConfig::Operator::TaggedSymbol
72
+ )
73
+ IS_BEFORE =
74
+ T.let(
75
+ :IS_BEFORE,
76
+ Trycourier::NestedFilterConfig::Operator::TaggedSymbol
77
+ )
78
+ LT = T.let(:LT, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
79
+ LTE =
80
+ T.let(:LTE, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
81
+ NEQ =
82
+ T.let(:NEQ, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
83
+ OMIT =
84
+ T.let(:OMIT, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
85
+ STARTS_WITH =
86
+ T.let(
87
+ :STARTS_WITH,
88
+ Trycourier::NestedFilterConfig::Operator::TaggedSymbol
89
+ )
90
+ AND =
91
+ T.let(:AND, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
92
+ OR = T.let(:OR, Trycourier::NestedFilterConfig::Operator::TaggedSymbol)
93
+
94
+ sig do
95
+ override.returns(
96
+ T::Array[Trycourier::NestedFilterConfig::Operator::TaggedSymbol]
97
+ )
98
+ end
99
+ def self.values
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,53 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class Pagerduty < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::Pagerduty, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(String)) }
12
+ attr_accessor :event_action
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :routing_key
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :severity
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_accessor :source
22
+
23
+ sig do
24
+ params(
25
+ event_action: T.nilable(String),
26
+ routing_key: T.nilable(String),
27
+ severity: T.nilable(String),
28
+ source: T.nilable(String)
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(
32
+ event_action: nil,
33
+ routing_key: nil,
34
+ severity: nil,
35
+ source: nil
36
+ )
37
+ end
38
+
39
+ sig do
40
+ override.returns(
41
+ {
42
+ event_action: T.nilable(String),
43
+ routing_key: T.nilable(String),
44
+ severity: T.nilable(String),
45
+ source: T.nilable(String)
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,31 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class PagerdutyRecipient < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::PagerdutyRecipient, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Trycourier::Pagerduty) }
12
+ attr_reader :pagerduty
13
+
14
+ sig { params(pagerduty: Trycourier::Pagerduty::OrHash).void }
15
+ attr_writer :pagerduty
16
+
17
+ # Send via PagerDuty
18
+ sig do
19
+ params(pagerduty: Trycourier::Pagerduty::OrHash).returns(
20
+ T.attached_class
21
+ )
22
+ end
23
+ def self.new(pagerduty:)
24
+ end
25
+
26
+ sig { override.returns({ pagerduty: Trycourier::Pagerduty }) }
27
+ def to_hash
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class SendDirectMessage < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::SendDirectMessage, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :user_id
13
+
14
+ sig { params(user_id: String).returns(T.attached_class) }
15
+ def self.new(user_id:)
16
+ end
17
+
18
+ sig { override.returns({ user_id: String }) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end
@@ -206,7 +206,16 @@ module Trycourier
206
206
  sig do
207
207
  returns(
208
208
  T.nilable(
209
- T.any(Trycourier::UserRecipient, T::Array[Trycourier::Recipient])
209
+ T.any(
210
+ Trycourier::UserRecipient,
211
+ Trycourier::AudienceRecipient,
212
+ Trycourier::ListRecipient,
213
+ Trycourier::ListPatternRecipient,
214
+ Trycourier::SlackRecipient,
215
+ Trycourier::MsTeamsRecipient,
216
+ Trycourier::PagerdutyRecipient,
217
+ Trycourier::WebhookRecipient
218
+ )
210
219
  )
211
220
  )
212
221
  end
@@ -263,7 +272,13 @@ module Trycourier
263
272
  T.nilable(
264
273
  T.any(
265
274
  Trycourier::UserRecipient::OrHash,
266
- T::Array[Trycourier::Recipient::OrHash]
275
+ Trycourier::AudienceRecipient::OrHash,
276
+ Trycourier::ListRecipient::OrHash,
277
+ Trycourier::ListPatternRecipient::OrHash,
278
+ Trycourier::SlackRecipient::OrHash,
279
+ Trycourier::MsTeamsRecipient::OrHash,
280
+ Trycourier::PagerdutyRecipient::OrHash,
281
+ Trycourier::WebhookRecipient::OrHash
267
282
  )
268
283
  )
269
284
  ).returns(T.attached_class)
@@ -332,7 +347,13 @@ module Trycourier
332
347
  T.nilable(
333
348
  T.any(
334
349
  Trycourier::UserRecipient,
335
- T::Array[Trycourier::Recipient]
350
+ Trycourier::AudienceRecipient,
351
+ Trycourier::ListRecipient,
352
+ Trycourier::ListPatternRecipient,
353
+ Trycourier::SlackRecipient,
354
+ Trycourier::MsTeamsRecipient,
355
+ Trycourier::PagerdutyRecipient,
356
+ Trycourier::WebhookRecipient
336
357
  )
337
358
  )
338
359
  }
@@ -1099,7 +1120,16 @@ module Trycourier
1099
1120
 
1100
1121
  Variants =
1101
1122
  T.type_alias do
1102
- T.any(Trycourier::UserRecipient, T::Array[Trycourier::Recipient])
1123
+ T.any(
1124
+ Trycourier::UserRecipient,
1125
+ Trycourier::AudienceRecipient,
1126
+ Trycourier::ListRecipient,
1127
+ Trycourier::ListPatternRecipient,
1128
+ Trycourier::SlackRecipient,
1129
+ Trycourier::MsTeamsRecipient,
1130
+ Trycourier::PagerdutyRecipient,
1131
+ Trycourier::WebhookRecipient
1132
+ )
1103
1133
  end
1104
1134
 
1105
1135
  sig do
@@ -1109,12 +1139,6 @@ module Trycourier
1109
1139
  end
1110
1140
  def self.variants
1111
1141
  end
1112
-
1113
- RecipientArray =
1114
- T.let(
1115
- Trycourier::Internal::Type::ArrayOf[Trycourier::Recipient],
1116
- Trycourier::Internal::Type::Converter
1117
- )
1118
1142
  end
1119
1143
  end
1120
1144
  end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class SendToChannel < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::SendToChannel, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :channel_id
13
+
14
+ sig { params(channel_id: String).returns(T.attached_class) }
15
+ def self.new(channel_id:)
16
+ end
17
+
18
+ sig { override.returns({ channel_id: String }) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end