trycourier 4.4.0 → 4.6.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 (172) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +9 -9
  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/automation_list_params.rb +47 -0
  15. data/lib/trycourier/models/automation_template.rb +61 -0
  16. data/lib/trycourier/models/automation_template_list_response.rb +24 -0
  17. data/lib/trycourier/models/device_type.rb +7 -0
  18. data/lib/trycourier/models/discord.rb +16 -0
  19. data/lib/trycourier/models/expo.rb +16 -0
  20. data/lib/trycourier/models/filter.rb +8 -51
  21. data/lib/trycourier/models/filter_config.rb +8 -51
  22. data/lib/trycourier/models/intercom.rb +21 -0
  23. data/lib/trycourier/models/intercom_recipient.rb +15 -0
  24. data/lib/trycourier/models/list_filter.rb +52 -0
  25. data/lib/trycourier/models/list_pattern_recipient.rb +23 -0
  26. data/lib/trycourier/models/list_recipient.rb +29 -0
  27. data/lib/trycourier/models/ms_teams.rb +22 -0
  28. data/lib/trycourier/models/ms_teams_base_properties.rb +21 -0
  29. data/lib/trycourier/models/ms_teams_recipient.rb +17 -0
  30. data/lib/trycourier/models/multiple_tokens.rb +15 -0
  31. data/lib/trycourier/models/nested_filter_config.rb +49 -0
  32. data/lib/trycourier/models/pagerduty.rb +33 -0
  33. data/lib/trycourier/models/pagerduty_recipient.rb +17 -0
  34. data/lib/trycourier/models/send_direct_message.rb +15 -0
  35. data/lib/trycourier/models/send_message_params.rb +24 -7
  36. data/lib/trycourier/models/send_to_channel.rb +15 -0
  37. data/lib/trycourier/models/send_to_ms_teams_channel_id.rb +27 -0
  38. data/lib/trycourier/models/send_to_ms_teams_channel_name.rb +33 -0
  39. data/lib/trycourier/models/send_to_ms_teams_conversation_id.rb +27 -0
  40. data/lib/trycourier/models/send_to_ms_teams_email.rb +27 -0
  41. data/lib/trycourier/models/send_to_ms_teams_user_id.rb +27 -0
  42. data/lib/trycourier/models/send_to_slack_channel.rb +21 -0
  43. data/lib/trycourier/models/send_to_slack_email.rb +21 -0
  44. data/lib/trycourier/models/send_to_slack_user_id.rb +21 -0
  45. data/lib/trycourier/models/single_filter_config.rb +62 -0
  46. data/lib/trycourier/models/slack.rb +18 -0
  47. data/lib/trycourier/models/slack_base_properties.rb +15 -0
  48. data/lib/trycourier/models/slack_recipient.rb +17 -0
  49. data/lib/trycourier/models/token.rb +15 -0
  50. data/lib/trycourier/models/user_profile.rb +274 -0
  51. data/lib/trycourier/models/user_profile_firebase_token.rb +19 -0
  52. data/lib/trycourier/models/webhook_auth_mode.rb +16 -0
  53. data/lib/trycourier/models/webhook_authentication.rb +40 -0
  54. data/lib/trycourier/models/webhook_method.rb +15 -0
  55. data/lib/trycourier/models/webhook_profile.rb +53 -0
  56. data/lib/trycourier/models/webhook_profile_type.rb +15 -0
  57. data/lib/trycourier/models/webhook_recipient.rb +17 -0
  58. data/lib/trycourier/models.rb +90 -2
  59. data/lib/trycourier/resources/audiences.rb +1 -1
  60. data/lib/trycourier/resources/automations.rb +27 -0
  61. data/lib/trycourier/version.rb +1 -1
  62. data/lib/trycourier.rb +45 -1
  63. data/rbi/trycourier/models/airship_profile.rbi +41 -0
  64. data/rbi/trycourier/models/airship_profile_audience.rbi +26 -0
  65. data/rbi/trycourier/models/audience.rbi +8 -7
  66. data/rbi/trycourier/models/audience_filter.rbi +88 -0
  67. data/rbi/trycourier/models/audience_recipient.rbi +52 -0
  68. data/rbi/trycourier/models/audience_update_params.rbi +25 -7
  69. data/rbi/trycourier/models/automation_list_params.rbi +95 -0
  70. data/rbi/trycourier/models/automation_template.rbi +102 -0
  71. data/rbi/trycourier/models/automation_template_list_response.rbi +54 -0
  72. data/rbi/trycourier/models/device_type.rbi +7 -0
  73. data/rbi/trycourier/models/discord.rbi +18 -0
  74. data/rbi/trycourier/models/expo.rbi +16 -0
  75. data/rbi/trycourier/models/filter.rbi +8 -78
  76. data/rbi/trycourier/models/filter_config.rbi +8 -83
  77. data/rbi/trycourier/models/intercom.rbi +35 -0
  78. data/rbi/trycourier/models/intercom_recipient.rbi +23 -0
  79. data/rbi/trycourier/models/list_filter.rbi +86 -0
  80. data/rbi/trycourier/models/list_pattern_recipient.rbi +39 -0
  81. data/rbi/trycourier/models/list_recipient.rbi +44 -0
  82. data/rbi/trycourier/models/ms_teams.rbi +24 -0
  83. data/rbi/trycourier/models/ms_teams_base_properties.rbi +31 -0
  84. data/rbi/trycourier/models/ms_teams_recipient.rbi +58 -0
  85. data/rbi/trycourier/models/multiple_tokens.rbi +27 -0
  86. data/rbi/trycourier/models/nested_filter_config.rbi +104 -0
  87. data/rbi/trycourier/models/pagerduty.rbi +53 -0
  88. data/rbi/trycourier/models/pagerduty_recipient.rbi +31 -0
  89. data/rbi/trycourier/models/send_direct_message.rbi +23 -0
  90. data/rbi/trycourier/models/send_message_params.rbi +34 -10
  91. data/rbi/trycourier/models/send_to_channel.rbi +23 -0
  92. data/rbi/trycourier/models/send_to_ms_teams_channel_id.rbi +42 -0
  93. data/rbi/trycourier/models/send_to_ms_teams_channel_name.rbi +51 -0
  94. data/rbi/trycourier/models/send_to_ms_teams_conversation_id.rbi +42 -0
  95. data/rbi/trycourier/models/send_to_ms_teams_email.rbi +37 -0
  96. data/rbi/trycourier/models/send_to_ms_teams_user_id.rbi +37 -0
  97. data/rbi/trycourier/models/send_to_slack_channel.rbi +28 -0
  98. data/rbi/trycourier/models/send_to_slack_email.rbi +28 -0
  99. data/rbi/trycourier/models/send_to_slack_user_id.rbi +28 -0
  100. data/rbi/trycourier/models/single_filter_config.rbi +116 -0
  101. data/rbi/trycourier/models/slack.rbi +22 -0
  102. data/rbi/trycourier/models/slack_base_properties.rbi +23 -0
  103. data/rbi/trycourier/models/slack_recipient.rbi +52 -0
  104. data/rbi/trycourier/models/token.rbi +21 -0
  105. data/rbi/trycourier/models/user_profile.rbi +377 -0
  106. data/rbi/trycourier/models/user_profile_firebase_token.rbi +25 -0
  107. data/rbi/trycourier/models/webhook_auth_mode.rbi +22 -0
  108. data/rbi/trycourier/models/webhook_authentication.rbi +64 -0
  109. data/rbi/trycourier/models/webhook_method.rbi +21 -0
  110. data/rbi/trycourier/models/webhook_profile.rbi +80 -0
  111. data/rbi/trycourier/models/webhook_profile_type.rbi +22 -0
  112. data/rbi/trycourier/models/webhook_recipient.rbi +31 -0
  113. data/rbi/trycourier/models.rbi +91 -2
  114. data/rbi/trycourier/resources/audiences.rbi +7 -1
  115. data/rbi/trycourier/resources/automations.rbi +19 -0
  116. data/sig/trycourier/models/airship_profile.rbs +25 -0
  117. data/sig/trycourier/models/airship_profile_audience.rbs +13 -0
  118. data/sig/trycourier/models/audience.rbs +4 -4
  119. data/sig/trycourier/models/audience_filter.rbs +50 -0
  120. data/sig/trycourier/models/audience_recipient.rbs +30 -0
  121. data/sig/trycourier/models/audience_update_params.rbs +8 -4
  122. data/sig/trycourier/models/automation_list_params.rbs +48 -0
  123. data/sig/trycourier/models/automation_template.rbs +55 -0
  124. data/sig/trycourier/models/automation_template_list_response.rbs +28 -0
  125. data/sig/trycourier/models/device_type.rbs +5 -0
  126. data/sig/trycourier/models/discord.rbs +11 -0
  127. data/sig/trycourier/models/expo.rbs +11 -0
  128. data/sig/trycourier/models/filter.rbs +4 -61
  129. data/sig/trycourier/models/filter_config.rbs +4 -61
  130. data/sig/trycourier/models/intercom.rbs +15 -0
  131. data/sig/trycourier/models/intercom_recipient.rbs +13 -0
  132. data/sig/trycourier/models/list_filter.rbs +50 -0
  133. data/sig/trycourier/models/list_pattern_recipient.rbs +19 -0
  134. data/sig/trycourier/models/list_recipient.rbs +30 -0
  135. data/sig/trycourier/models/ms_teams.rbs +16 -0
  136. data/sig/trycourier/models/ms_teams_base_properties.rbs +15 -0
  137. data/sig/trycourier/models/ms_teams_recipient.rbs +13 -0
  138. data/sig/trycourier/models/multiple_tokens.rbs +13 -0
  139. data/sig/trycourier/models/nested_filter_config.rbs +64 -0
  140. data/sig/trycourier/models/pagerduty.rbs +35 -0
  141. data/sig/trycourier/models/pagerduty_recipient.rbs +13 -0
  142. data/sig/trycourier/models/send_direct_message.rbs +13 -0
  143. data/sig/trycourier/models/send_message_params.rbs +9 -3
  144. data/sig/trycourier/models/send_to_channel.rbs +13 -0
  145. data/sig/trycourier/models/send_to_ms_teams_channel_id.rbs +26 -0
  146. data/sig/trycourier/models/send_to_ms_teams_channel_name.rbs +35 -0
  147. data/sig/trycourier/models/send_to_ms_teams_conversation_id.rbs +26 -0
  148. data/sig/trycourier/models/send_to_ms_teams_email.rbs +22 -0
  149. data/sig/trycourier/models/send_to_ms_teams_user_id.rbs +26 -0
  150. data/sig/trycourier/models/send_to_slack_channel.rbs +15 -0
  151. data/sig/trycourier/models/send_to_slack_email.rbs +15 -0
  152. data/sig/trycourier/models/send_to_slack_user_id.rbs +15 -0
  153. data/sig/trycourier/models/single_filter_config.rbs +69 -0
  154. data/sig/trycourier/models/slack.rbs +14 -0
  155. data/sig/trycourier/models/slack_base_properties.rbs +13 -0
  156. data/sig/trycourier/models/slack_recipient.rbs +13 -0
  157. data/sig/trycourier/models/token.rbs +13 -0
  158. data/sig/trycourier/models/user_profile.rbs +212 -0
  159. data/sig/trycourier/models/user_profile_firebase_token.rbs +13 -0
  160. data/sig/trycourier/models/webhook_auth_mode.rbs +15 -0
  161. data/sig/trycourier/models/webhook_authentication.rbs +35 -0
  162. data/sig/trycourier/models/webhook_method.rbs +14 -0
  163. data/sig/trycourier/models/webhook_profile.rbs +40 -0
  164. data/sig/trycourier/models/webhook_profile_type.rbs +14 -0
  165. data/sig/trycourier/models/webhook_recipient.rbs +13 -0
  166. data/sig/trycourier/models.rbs +92 -4
  167. data/sig/trycourier/resources/audiences.rbs +1 -1
  168. data/sig/trycourier/resources/automations.rbs +6 -0
  169. metadata +137 -5
  170. data/lib/trycourier/models/recipient.rb +0 -113
  171. data/rbi/trycourier/models/recipient.rbi +0 -161
  172. data/sig/trycourier/models/recipient.rbs +0 -92
@@ -0,0 +1,95 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class AutomationListParams < Trycourier::Internal::Type::BaseModel
6
+ extend Trycourier::Internal::Type::RequestParameters::Converter
7
+ include Trycourier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Trycourier::AutomationListParams, Trycourier::Internal::AnyHash)
12
+ end
13
+
14
+ # A cursor token for pagination. Use the cursor from the previous response to
15
+ # fetch the next page of results.
16
+ sig { returns(T.nilable(String)) }
17
+ attr_reader :cursor
18
+
19
+ sig { params(cursor: String).void }
20
+ attr_writer :cursor
21
+
22
+ # The version of templates to retrieve. Accepted values are published (for
23
+ # published templates) or draft (for draft templates). Defaults to published.
24
+ sig do
25
+ returns(T.nilable(Trycourier::AutomationListParams::Version::OrSymbol))
26
+ end
27
+ attr_reader :version
28
+
29
+ sig do
30
+ params(
31
+ version: Trycourier::AutomationListParams::Version::OrSymbol
32
+ ).void
33
+ end
34
+ attr_writer :version
35
+
36
+ sig do
37
+ params(
38
+ cursor: String,
39
+ version: Trycourier::AutomationListParams::Version::OrSymbol,
40
+ request_options: Trycourier::RequestOptions::OrHash
41
+ ).returns(T.attached_class)
42
+ end
43
+ def self.new(
44
+ # A cursor token for pagination. Use the cursor from the previous response to
45
+ # fetch the next page of results.
46
+ cursor: nil,
47
+ # The version of templates to retrieve. Accepted values are published (for
48
+ # published templates) or draft (for draft templates). Defaults to published.
49
+ version: nil,
50
+ request_options: {}
51
+ )
52
+ end
53
+
54
+ sig do
55
+ override.returns(
56
+ {
57
+ cursor: String,
58
+ version: Trycourier::AutomationListParams::Version::OrSymbol,
59
+ request_options: Trycourier::RequestOptions
60
+ }
61
+ )
62
+ end
63
+ def to_hash
64
+ end
65
+
66
+ # The version of templates to retrieve. Accepted values are published (for
67
+ # published templates) or draft (for draft templates). Defaults to published.
68
+ module Version
69
+ extend Trycourier::Internal::Type::Enum
70
+
71
+ TaggedSymbol =
72
+ T.type_alias do
73
+ T.all(Symbol, Trycourier::AutomationListParams::Version)
74
+ end
75
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
76
+
77
+ PUBLISHED =
78
+ T.let(
79
+ :published,
80
+ Trycourier::AutomationListParams::Version::TaggedSymbol
81
+ )
82
+ DRAFT =
83
+ T.let(:draft, Trycourier::AutomationListParams::Version::TaggedSymbol)
84
+
85
+ sig do
86
+ override.returns(
87
+ T::Array[Trycourier::AutomationListParams::Version::TaggedSymbol]
88
+ )
89
+ end
90
+ def self.values
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,102 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class AutomationTemplate < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Trycourier::AutomationTemplate, Trycourier::Internal::AnyHash)
9
+ end
10
+
11
+ # The unique identifier of the automation template.
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # The name of the automation template.
16
+ sig { returns(String) }
17
+ attr_accessor :name
18
+
19
+ # The version of the template published, draft.
20
+ sig { returns(Trycourier::AutomationTemplate::Version::TaggedSymbol) }
21
+ attr_accessor :version
22
+
23
+ # ISO 8601 timestamp when the template was created.
24
+ sig { returns(T.nilable(Time)) }
25
+ attr_reader :created_at
26
+
27
+ sig { params(created_at: Time).void }
28
+ attr_writer :created_at
29
+
30
+ # ISO 8601 timestamp when the template was last updated.
31
+ sig { returns(T.nilable(Time)) }
32
+ attr_reader :updated_at
33
+
34
+ sig { params(updated_at: Time).void }
35
+ attr_writer :updated_at
36
+
37
+ sig do
38
+ params(
39
+ id: String,
40
+ name: String,
41
+ version: Trycourier::AutomationTemplate::Version::OrSymbol,
42
+ created_at: Time,
43
+ updated_at: Time
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ # The unique identifier of the automation template.
48
+ id:,
49
+ # The name of the automation template.
50
+ name:,
51
+ # The version of the template published, draft.
52
+ version:,
53
+ # ISO 8601 timestamp when the template was created.
54
+ created_at: nil,
55
+ # ISO 8601 timestamp when the template was last updated.
56
+ updated_at: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ id: String,
64
+ name: String,
65
+ version: Trycourier::AutomationTemplate::Version::TaggedSymbol,
66
+ created_at: Time,
67
+ updated_at: Time
68
+ }
69
+ )
70
+ end
71
+ def to_hash
72
+ end
73
+
74
+ # The version of the template published, draft.
75
+ module Version
76
+ extend Trycourier::Internal::Type::Enum
77
+
78
+ TaggedSymbol =
79
+ T.type_alias do
80
+ T.all(Symbol, Trycourier::AutomationTemplate::Version)
81
+ end
82
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
83
+
84
+ PUBLISHED =
85
+ T.let(
86
+ :published,
87
+ Trycourier::AutomationTemplate::Version::TaggedSymbol
88
+ )
89
+ DRAFT =
90
+ T.let(:draft, Trycourier::AutomationTemplate::Version::TaggedSymbol)
91
+
92
+ sig do
93
+ override.returns(
94
+ T::Array[Trycourier::AutomationTemplate::Version::TaggedSymbol]
95
+ )
96
+ end
97
+ def self.values
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ class AutomationTemplateListResponse < Trycourier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Trycourier::AutomationTemplateListResponse,
10
+ Trycourier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # A cursor token for pagination. Present when there are more results available.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :cursor
17
+
18
+ sig { params(cursor: String).void }
19
+ attr_writer :cursor
20
+
21
+ sig { returns(T.nilable(T::Array[Trycourier::AutomationTemplate])) }
22
+ attr_reader :templates
23
+
24
+ sig do
25
+ params(templates: T::Array[Trycourier::AutomationTemplate::OrHash]).void
26
+ end
27
+ attr_writer :templates
28
+
29
+ sig do
30
+ params(
31
+ cursor: String,
32
+ templates: T::Array[Trycourier::AutomationTemplate::OrHash]
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(
36
+ # A cursor token for pagination. Present when there are more results available.
37
+ cursor: nil,
38
+ templates: nil
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ cursor: String,
46
+ templates: T::Array[Trycourier::AutomationTemplate]
47
+ }
48
+ )
49
+ end
50
+ def to_hash
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,7 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ DeviceType = String
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ module Discord
6
+ extend Trycourier::Internal::Type::Union
7
+
8
+ Variants =
9
+ T.type_alias do
10
+ T.any(Trycourier::SendToChannel, Trycourier::SendDirectMessage)
11
+ end
12
+
13
+ sig { override.returns(T::Array[Trycourier::Discord::Variants]) }
14
+ def self.variants
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ # typed: strong
2
+
3
+ module Trycourier
4
+ module Models
5
+ module Expo
6
+ extend Trycourier::Internal::Type::Union
7
+
8
+ Variants =
9
+ T.type_alias { T.any(Trycourier::Token, Trycourier::MultipleTokens) }
10
+
11
+ sig { override.returns(T::Array[Trycourier::Expo::Variants]) }
12
+ def self.variants
13
+ end
14
+ end
15
+ end
16
+ end
@@ -2,87 +2,17 @@
2
2
 
3
3
  module Trycourier
4
4
  module Models
5
- class Filter < Trycourier::Internal::Type::BaseModel
6
- OrHash =
5
+ # A single filter to use for filtering
6
+ module Filter
7
+ extend Trycourier::Internal::Type::Union
8
+
9
+ Variants =
7
10
  T.type_alias do
8
- T.any(Trycourier::Filter, Trycourier::Internal::AnyHash)
11
+ T.any(Trycourier::SingleFilterConfig, Trycourier::NestedFilterConfig)
9
12
  end
10
13
 
11
- # The operator to use for filtering
12
- sig { returns(Trycourier::Filter::Operator::OrSymbol) }
13
- attr_accessor :operator
14
-
15
- # The attribe name from profile whose value will be operated against the filter
16
- # value
17
- sig { returns(String) }
18
- attr_accessor :path
19
-
20
- # The value to use for filtering
21
- sig { returns(String) }
22
- attr_accessor :value
23
-
24
- sig do
25
- params(
26
- operator: Trycourier::Filter::Operator::OrSymbol,
27
- path: String,
28
- value: String
29
- ).returns(T.attached_class)
30
- end
31
- def self.new(
32
- # The operator to use for filtering
33
- operator:,
34
- # The attribe name from profile whose value will be operated against the filter
35
- # value
36
- path:,
37
- # The value to use for filtering
38
- value:
39
- )
40
- end
41
-
42
- sig do
43
- override.returns(
44
- {
45
- operator: Trycourier::Filter::Operator::OrSymbol,
46
- path: String,
47
- value: String
48
- }
49
- )
50
- end
51
- def to_hash
52
- end
53
-
54
- # The operator to use for filtering
55
- module Operator
56
- extend Trycourier::Internal::Type::Enum
57
-
58
- TaggedSymbol =
59
- T.type_alias { T.all(Symbol, Trycourier::Filter::Operator) }
60
- OrSymbol = T.type_alias { T.any(Symbol, String) }
61
-
62
- ENDS_WITH =
63
- T.let(:ENDS_WITH, Trycourier::Filter::Operator::TaggedSymbol)
64
- EQ = T.let(:EQ, Trycourier::Filter::Operator::TaggedSymbol)
65
- EXISTS = T.let(:EXISTS, Trycourier::Filter::Operator::TaggedSymbol)
66
- GT = T.let(:GT, Trycourier::Filter::Operator::TaggedSymbol)
67
- GTE = T.let(:GTE, Trycourier::Filter::Operator::TaggedSymbol)
68
- INCLUDES = T.let(:INCLUDES, Trycourier::Filter::Operator::TaggedSymbol)
69
- IS_AFTER = T.let(:IS_AFTER, Trycourier::Filter::Operator::TaggedSymbol)
70
- IS_BEFORE =
71
- T.let(:IS_BEFORE, Trycourier::Filter::Operator::TaggedSymbol)
72
- LT = T.let(:LT, Trycourier::Filter::Operator::TaggedSymbol)
73
- LTE = T.let(:LTE, Trycourier::Filter::Operator::TaggedSymbol)
74
- NEQ = T.let(:NEQ, Trycourier::Filter::Operator::TaggedSymbol)
75
- OMIT = T.let(:OMIT, Trycourier::Filter::Operator::TaggedSymbol)
76
- STARTS_WITH =
77
- T.let(:STARTS_WITH, Trycourier::Filter::Operator::TaggedSymbol)
78
- AND = T.let(:AND, Trycourier::Filter::Operator::TaggedSymbol)
79
- OR = T.let(:OR, Trycourier::Filter::Operator::TaggedSymbol)
80
-
81
- sig do
82
- override.returns(T::Array[Trycourier::Filter::Operator::TaggedSymbol])
83
- end
84
- def self.values
85
- end
14
+ sig { override.returns(T::Array[Trycourier::Filter::Variants]) }
15
+ def self.variants
86
16
  end
87
17
  end
88
18
  end
@@ -2,92 +2,17 @@
2
2
 
3
3
  module Trycourier
4
4
  module Models
5
- class FilterConfig < Trycourier::Internal::Type::BaseModel
6
- OrHash =
5
+ # A single filter to use for filtering
6
+ module FilterConfig
7
+ extend Trycourier::Internal::Type::Union
8
+
9
+ Variants =
7
10
  T.type_alias do
8
- T.any(Trycourier::FilterConfig, Trycourier::Internal::AnyHash)
11
+ T.any(Trycourier::SingleFilterConfig, Trycourier::NestedFilterConfig)
9
12
  end
10
13
 
11
- # The operator to use for filtering
12
- sig { returns(Trycourier::FilterConfig::Operator::OrSymbol) }
13
- attr_accessor :operator
14
-
15
- # The attribe name from profile whose value will be operated against the filter
16
- # value
17
- sig { returns(String) }
18
- attr_accessor :path
19
-
20
- # The value to use for filtering
21
- sig { returns(String) }
22
- attr_accessor :value
23
-
24
- sig do
25
- params(
26
- operator: Trycourier::FilterConfig::Operator::OrSymbol,
27
- path: String,
28
- value: String
29
- ).returns(T.attached_class)
30
- end
31
- def self.new(
32
- # The operator to use for filtering
33
- operator:,
34
- # The attribe name from profile whose value will be operated against the filter
35
- # value
36
- path:,
37
- # The value to use for filtering
38
- value:
39
- )
40
- end
41
-
42
- sig do
43
- override.returns(
44
- {
45
- operator: Trycourier::FilterConfig::Operator::OrSymbol,
46
- path: String,
47
- value: String
48
- }
49
- )
50
- end
51
- def to_hash
52
- end
53
-
54
- # The operator to use for filtering
55
- module Operator
56
- extend Trycourier::Internal::Type::Enum
57
-
58
- TaggedSymbol =
59
- T.type_alias { T.all(Symbol, Trycourier::FilterConfig::Operator) }
60
- OrSymbol = T.type_alias { T.any(Symbol, String) }
61
-
62
- ENDS_WITH =
63
- T.let(:ENDS_WITH, Trycourier::FilterConfig::Operator::TaggedSymbol)
64
- EQ = T.let(:EQ, Trycourier::FilterConfig::Operator::TaggedSymbol)
65
- EXISTS =
66
- T.let(:EXISTS, Trycourier::FilterConfig::Operator::TaggedSymbol)
67
- GT = T.let(:GT, Trycourier::FilterConfig::Operator::TaggedSymbol)
68
- GTE = T.let(:GTE, Trycourier::FilterConfig::Operator::TaggedSymbol)
69
- INCLUDES =
70
- T.let(:INCLUDES, Trycourier::FilterConfig::Operator::TaggedSymbol)
71
- IS_AFTER =
72
- T.let(:IS_AFTER, Trycourier::FilterConfig::Operator::TaggedSymbol)
73
- IS_BEFORE =
74
- T.let(:IS_BEFORE, Trycourier::FilterConfig::Operator::TaggedSymbol)
75
- LT = T.let(:LT, Trycourier::FilterConfig::Operator::TaggedSymbol)
76
- LTE = T.let(:LTE, Trycourier::FilterConfig::Operator::TaggedSymbol)
77
- NEQ = T.let(:NEQ, Trycourier::FilterConfig::Operator::TaggedSymbol)
78
- OMIT = T.let(:OMIT, Trycourier::FilterConfig::Operator::TaggedSymbol)
79
- STARTS_WITH =
80
- T.let(:STARTS_WITH, Trycourier::FilterConfig::Operator::TaggedSymbol)
81
- AND = T.let(:AND, Trycourier::FilterConfig::Operator::TaggedSymbol)
82
- OR = T.let(:OR, Trycourier::FilterConfig::Operator::TaggedSymbol)
83
-
84
- sig do
85
- override.returns(
86
- T::Array[Trycourier::FilterConfig::Operator::TaggedSymbol]
87
- )
88
- end
89
- def self.values
90
- end
14
+ sig { override.returns(T::Array[Trycourier::FilterConfig::Variants]) }
15
+ def self.variants
91
16
  end
92
17
  end
93
18
  end
@@ -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