trycourier 4.3.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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -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/bulk_create_job_params.rb +12 -3
  15. data/lib/trycourier/models/bulk_retrieve_job_response.rb +15 -3
  16. data/lib/trycourier/models/device_type.rb +7 -0
  17. data/lib/trycourier/models/discord.rb +16 -0
  18. data/lib/trycourier/models/expo.rb +16 -0
  19. data/lib/trycourier/models/filter.rb +8 -51
  20. data/lib/trycourier/models/filter_config.rb +8 -51
  21. data/lib/trycourier/models/inbound_bulk_message.rb +79 -113
  22. data/lib/trycourier/models/inbound_bulk_message_user.rb +21 -6
  23. data/lib/trycourier/models/intercom.rb +21 -0
  24. data/lib/trycourier/models/intercom_recipient.rb +15 -0
  25. data/lib/trycourier/models/list_filter.rb +52 -0
  26. data/lib/trycourier/models/list_pattern_recipient.rb +23 -0
  27. data/lib/trycourier/models/list_recipient.rb +29 -0
  28. data/lib/trycourier/models/ms_teams.rb +22 -0
  29. data/lib/trycourier/models/ms_teams_base_properties.rb +21 -0
  30. data/lib/trycourier/models/ms_teams_recipient.rb +17 -0
  31. data/lib/trycourier/models/multiple_tokens.rb +15 -0
  32. data/lib/trycourier/models/nested_filter_config.rb +49 -0
  33. data/lib/trycourier/models/pagerduty.rb +33 -0
  34. data/lib/trycourier/models/pagerduty_recipient.rb +17 -0
  35. data/lib/trycourier/models/send_direct_message.rb +15 -0
  36. data/lib/trycourier/models/send_message_params.rb +38 -8
  37. data/lib/trycourier/models/send_to_channel.rb +15 -0
  38. data/lib/trycourier/models/send_to_ms_teams_channel_id.rb +27 -0
  39. data/lib/trycourier/models/send_to_ms_teams_channel_name.rb +33 -0
  40. data/lib/trycourier/models/send_to_ms_teams_conversation_id.rb +27 -0
  41. data/lib/trycourier/models/send_to_ms_teams_email.rb +27 -0
  42. data/lib/trycourier/models/send_to_ms_teams_user_id.rb +27 -0
  43. data/lib/trycourier/models/send_to_slack_channel.rb +21 -0
  44. data/lib/trycourier/models/send_to_slack_email.rb +21 -0
  45. data/lib/trycourier/models/send_to_slack_user_id.rb +21 -0
  46. data/lib/trycourier/models/single_filter_config.rb +62 -0
  47. data/lib/trycourier/models/slack.rb +18 -0
  48. data/lib/trycourier/models/slack_base_properties.rb +15 -0
  49. data/lib/trycourier/models/slack_recipient.rb +17 -0
  50. data/lib/trycourier/models/token.rb +15 -0
  51. data/lib/trycourier/models/user_profile.rb +274 -0
  52. data/lib/trycourier/models/user_profile_firebase_token.rb +19 -0
  53. data/lib/trycourier/models/webhook_auth_mode.rb +16 -0
  54. data/lib/trycourier/models/webhook_authentication.rb +40 -0
  55. data/lib/trycourier/models/webhook_method.rb +15 -0
  56. data/lib/trycourier/models/webhook_profile.rb +53 -0
  57. data/lib/trycourier/models/webhook_profile_type.rb +15 -0
  58. data/lib/trycourier/models/webhook_recipient.rb +17 -0
  59. data/lib/trycourier/models.rb +84 -2
  60. data/lib/trycourier/resources/audiences.rb +1 -1
  61. data/lib/trycourier/resources/bulk.rb +17 -3
  62. data/lib/trycourier/version.rb +1 -1
  63. data/lib/trycourier.rb +42 -1
  64. data/rbi/trycourier/models/airship_profile.rbi +41 -0
  65. data/rbi/trycourier/models/airship_profile_audience.rbi +26 -0
  66. data/rbi/trycourier/models/audience.rbi +8 -7
  67. data/rbi/trycourier/models/audience_filter.rbi +88 -0
  68. data/rbi/trycourier/models/audience_recipient.rbi +52 -0
  69. data/rbi/trycourier/models/audience_update_params.rbi +25 -7
  70. data/rbi/trycourier/models/bulk_create_job_params.rbi +21 -20
  71. data/rbi/trycourier/models/bulk_retrieve_job_response.rbi +24 -9
  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/inbound_bulk_message.rbi +97 -153
  78. data/rbi/trycourier/models/inbound_bulk_message_user.rbi +20 -7
  79. data/rbi/trycourier/models/intercom.rbi +35 -0
  80. data/rbi/trycourier/models/intercom_recipient.rbi +23 -0
  81. data/rbi/trycourier/models/list_filter.rbi +86 -0
  82. data/rbi/trycourier/models/list_pattern_recipient.rbi +39 -0
  83. data/rbi/trycourier/models/list_recipient.rbi +44 -0
  84. data/rbi/trycourier/models/ms_teams.rbi +24 -0
  85. data/rbi/trycourier/models/ms_teams_base_properties.rbi +31 -0
  86. data/rbi/trycourier/models/ms_teams_recipient.rbi +58 -0
  87. data/rbi/trycourier/models/multiple_tokens.rbi +27 -0
  88. data/rbi/trycourier/models/nested_filter_config.rbi +104 -0
  89. data/rbi/trycourier/models/pagerduty.rbi +53 -0
  90. data/rbi/trycourier/models/pagerduty_recipient.rbi +31 -0
  91. data/rbi/trycourier/models/send_direct_message.rbi +23 -0
  92. data/rbi/trycourier/models/send_message_params.rbi +50 -11
  93. data/rbi/trycourier/models/send_to_channel.rbi +23 -0
  94. data/rbi/trycourier/models/send_to_ms_teams_channel_id.rbi +42 -0
  95. data/rbi/trycourier/models/send_to_ms_teams_channel_name.rbi +51 -0
  96. data/rbi/trycourier/models/send_to_ms_teams_conversation_id.rbi +42 -0
  97. data/rbi/trycourier/models/send_to_ms_teams_email.rbi +37 -0
  98. data/rbi/trycourier/models/send_to_ms_teams_user_id.rbi +37 -0
  99. data/rbi/trycourier/models/send_to_slack_channel.rbi +28 -0
  100. data/rbi/trycourier/models/send_to_slack_email.rbi +28 -0
  101. data/rbi/trycourier/models/send_to_slack_user_id.rbi +28 -0
  102. data/rbi/trycourier/models/single_filter_config.rbi +116 -0
  103. data/rbi/trycourier/models/slack.rbi +22 -0
  104. data/rbi/trycourier/models/slack_base_properties.rbi +23 -0
  105. data/rbi/trycourier/models/slack_recipient.rbi +52 -0
  106. data/rbi/trycourier/models/token.rbi +21 -0
  107. data/rbi/trycourier/models/user_profile.rbi +377 -0
  108. data/rbi/trycourier/models/user_profile_firebase_token.rbi +25 -0
  109. data/rbi/trycourier/models/webhook_auth_mode.rbi +22 -0
  110. data/rbi/trycourier/models/webhook_authentication.rbi +64 -0
  111. data/rbi/trycourier/models/webhook_method.rbi +21 -0
  112. data/rbi/trycourier/models/webhook_profile.rbi +80 -0
  113. data/rbi/trycourier/models/webhook_profile_type.rbi +22 -0
  114. data/rbi/trycourier/models/webhook_recipient.rbi +31 -0
  115. data/rbi/trycourier/models.rbi +84 -2
  116. data/rbi/trycourier/resources/audiences.rbi +7 -1
  117. data/rbi/trycourier/resources/bulk.rbi +22 -8
  118. data/sig/trycourier/models/airship_profile.rbs +25 -0
  119. data/sig/trycourier/models/airship_profile_audience.rbs +13 -0
  120. data/sig/trycourier/models/audience.rbs +4 -4
  121. data/sig/trycourier/models/audience_filter.rbs +50 -0
  122. data/sig/trycourier/models/audience_recipient.rbs +30 -0
  123. data/sig/trycourier/models/audience_update_params.rbs +8 -4
  124. data/sig/trycourier/models/bulk_create_job_params.rbs +4 -4
  125. data/sig/trycourier/models/bulk_retrieve_job_response.rbs +4 -4
  126. data/sig/trycourier/models/device_type.rbs +5 -0
  127. data/sig/trycourier/models/discord.rbs +11 -0
  128. data/sig/trycourier/models/expo.rbs +11 -0
  129. data/sig/trycourier/models/filter.rbs +4 -61
  130. data/sig/trycourier/models/filter_config.rbs +4 -61
  131. data/sig/trycourier/models/inbound_bulk_message.rbs +52 -99
  132. data/sig/trycourier/models/inbound_bulk_message_user.rbs +4 -6
  133. data/sig/trycourier/models/intercom.rbs +15 -0
  134. data/sig/trycourier/models/intercom_recipient.rbs +13 -0
  135. data/sig/trycourier/models/list_filter.rbs +50 -0
  136. data/sig/trycourier/models/list_pattern_recipient.rbs +19 -0
  137. data/sig/trycourier/models/list_recipient.rbs +30 -0
  138. data/sig/trycourier/models/ms_teams.rbs +16 -0
  139. data/sig/trycourier/models/ms_teams_base_properties.rbs +15 -0
  140. data/sig/trycourier/models/ms_teams_recipient.rbs +13 -0
  141. data/sig/trycourier/models/multiple_tokens.rbs +13 -0
  142. data/sig/trycourier/models/nested_filter_config.rbs +64 -0
  143. data/sig/trycourier/models/pagerduty.rbs +35 -0
  144. data/sig/trycourier/models/pagerduty_recipient.rbs +13 -0
  145. data/sig/trycourier/models/send_direct_message.rbs +13 -0
  146. data/sig/trycourier/models/send_message_params.rbs +22 -6
  147. data/sig/trycourier/models/send_to_channel.rbs +13 -0
  148. data/sig/trycourier/models/send_to_ms_teams_channel_id.rbs +26 -0
  149. data/sig/trycourier/models/send_to_ms_teams_channel_name.rbs +35 -0
  150. data/sig/trycourier/models/send_to_ms_teams_conversation_id.rbs +26 -0
  151. data/sig/trycourier/models/send_to_ms_teams_email.rbs +22 -0
  152. data/sig/trycourier/models/send_to_ms_teams_user_id.rbs +26 -0
  153. data/sig/trycourier/models/send_to_slack_channel.rbs +15 -0
  154. data/sig/trycourier/models/send_to_slack_email.rbs +15 -0
  155. data/sig/trycourier/models/send_to_slack_user_id.rbs +15 -0
  156. data/sig/trycourier/models/single_filter_config.rbs +69 -0
  157. data/sig/trycourier/models/slack.rbs +14 -0
  158. data/sig/trycourier/models/slack_base_properties.rbs +13 -0
  159. data/sig/trycourier/models/slack_recipient.rbs +13 -0
  160. data/sig/trycourier/models/token.rbs +13 -0
  161. data/sig/trycourier/models/user_profile.rbs +212 -0
  162. data/sig/trycourier/models/user_profile_firebase_token.rbs +13 -0
  163. data/sig/trycourier/models/webhook_auth_mode.rbs +15 -0
  164. data/sig/trycourier/models/webhook_authentication.rbs +35 -0
  165. data/sig/trycourier/models/webhook_method.rbs +14 -0
  166. data/sig/trycourier/models/webhook_profile.rbs +40 -0
  167. data/sig/trycourier/models/webhook_profile_type.rbs +14 -0
  168. data/sig/trycourier/models/webhook_recipient.rbs +13 -0
  169. data/sig/trycourier/models.rbs +87 -5
  170. data/sig/trycourier/resources/audiences.rbs +1 -1
  171. data/sig/trycourier/resources/bulk.rbs +1 -1
  172. metadata +128 -5
  173. data/lib/trycourier/models/recipient.rb +0 -113
  174. data/rbi/trycourier/models/recipient.rbi +0 -161
  175. data/sig/trycourier/models/recipient.rbs +0 -92
@@ -2,124 +2,90 @@
2
2
 
3
3
  module Trycourier
4
4
  module Models
5
- module InboundBulkMessage
6
- extend Trycourier::Internal::Type::Union
7
-
8
- variant -> { Trycourier::InboundBulkMessage::InboundBulkTemplateMessage }
9
-
10
- variant -> { Trycourier::InboundBulkMessage::InboundBulkContentMessage }
11
-
12
- class InboundBulkTemplateMessage < Trycourier::Internal::Type::BaseModel
13
- # @!attribute template
14
- #
15
- # @return [String]
16
- required :template, String
17
-
18
- # @!attribute brand
19
- #
20
- # @return [String, nil]
21
- optional :brand, String, nil?: true
22
-
23
- # @!attribute data
24
- #
25
- # @return [Hash{Symbol=>Object}, nil]
26
- optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
27
-
28
- # @!attribute event
29
- #
30
- # @return [String, nil]
31
- optional :event, String, nil?: true
32
-
33
- # @!attribute locale
34
- #
35
- # @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
36
- optional :locale,
37
- Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown]],
38
- nil?: true
39
-
40
- # @!attribute override
41
- #
42
- # @return [Hash{Symbol=>Object}, nil]
43
- optional :override,
44
- Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown],
45
- nil?: true
46
-
47
- # @!method initialize(template:, brand: nil, data: nil, event: nil, locale: nil, override: nil)
48
- # @param template [String]
49
- # @param brand [String, nil]
50
- # @param data [Hash{Symbol=>Object}, nil]
51
- # @param event [String, nil]
52
- # @param locale [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
53
- # @param override [Hash{Symbol=>Object}, nil]
54
- end
55
-
56
- class InboundBulkContentMessage < Trycourier::Internal::Type::BaseModel
57
- # @!attribute content
58
- # Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
59
- #
60
- # @return [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent]
61
- required :content, union: -> { Trycourier::InboundBulkMessage::InboundBulkContentMessage::Content }
62
-
63
- # @!attribute brand
64
- #
65
- # @return [String, nil]
66
- optional :brand, String, nil?: true
67
-
68
- # @!attribute data
69
- #
70
- # @return [Hash{Symbol=>Object}, nil]
71
- optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
72
-
73
- # @!attribute event
74
- #
75
- # @return [String, nil]
76
- optional :event, String, nil?: true
77
-
78
- # @!attribute locale
79
- #
80
- # @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
81
- optional :locale,
82
- Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown]],
83
- nil?: true
84
-
85
- # @!attribute override
86
- #
87
- # @return [Hash{Symbol=>Object}, nil]
88
- optional :override,
89
- Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown],
90
- nil?: true
91
-
92
- # @!method initialize(content:, brand: nil, data: nil, event: nil, locale: nil, override: nil)
93
- # @param content [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent] Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
94
- #
95
- # @param brand [String, nil]
96
- #
97
- # @param data [Hash{Symbol=>Object}, nil]
98
- #
99
- # @param event [String, nil]
100
- #
101
- # @param locale [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
102
- #
103
- # @param override [Hash{Symbol=>Object}, nil]
5
+ class InboundBulkMessage < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute event
7
+ # Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
8
+ # "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
9
+ # mapped to a notification.
10
+ #
11
+ # @return [String]
12
+ required :event, String
13
+
14
+ # @!attribute brand
15
+ #
16
+ # @return [String, nil]
17
+ optional :brand, String, nil?: true
18
+
19
+ # @!attribute content
20
+ # Elemental content (optional, for V2 format). When provided, this will be used
21
+ # instead of the notification associated with the `event` field.
22
+ #
23
+ # @return [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent, nil]
24
+ optional :content, union: -> { Trycourier::InboundBulkMessage::Content }, nil?: true
25
+
26
+ # @!attribute data
27
+ #
28
+ # @return [Hash{Symbol=>Object}, nil]
29
+ optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
30
+
31
+ # @!attribute locale
32
+ #
33
+ # @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
34
+ optional :locale,
35
+ Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown]],
36
+ nil?: true
37
+
38
+ # @!attribute override
39
+ #
40
+ # @return [Hash{Symbol=>Object}, nil]
41
+ optional :override, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
42
+
43
+ # @!attribute template
44
+ # Notification ID or template ID (optional, for V2 format). When provided, this
45
+ # will be used instead of the notification associated with the `event` field.
46
+ #
47
+ # @return [String, nil]
48
+ optional :template, String, nil?: true
49
+
50
+ # @!method initialize(event:, brand: nil, content: nil, data: nil, locale: nil, override: nil, template: nil)
51
+ # Some parameter documentations has been truncated, see
52
+ # {Trycourier::Models::InboundBulkMessage} for more details.
53
+ #
54
+ # Bulk message definition. Supports two formats:
55
+ #
56
+ # - V1 format: Requires `event` field (event ID or notification ID)
57
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
58
+ # content) in addition to `event`
59
+ #
60
+ # @param event [String] Event ID or Notification ID (required). Can be either a
61
+ #
62
+ # @param brand [String, nil]
63
+ #
64
+ # @param content [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent, nil] Elemental content (optional, for V2 format). When provided, this will be used
65
+ #
66
+ # @param data [Hash{Symbol=>Object}, nil]
67
+ #
68
+ # @param locale [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
69
+ #
70
+ # @param override [Hash{Symbol=>Object}, nil]
71
+ #
72
+ # @param template [String, nil] Notification ID or template ID (optional, for V2 format). When provided,
73
+
74
+ # Elemental content (optional, for V2 format). When provided, this will be used
75
+ # instead of the notification associated with the `event` field.
76
+ #
77
+ # @see Trycourier::Models::InboundBulkMessage#content
78
+ module Content
79
+ extend Trycourier::Internal::Type::Union
104
80
 
105
81
  # Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
106
- #
107
- # @see Trycourier::Models::InboundBulkMessage::InboundBulkContentMessage#content
108
- module Content
109
- extend Trycourier::Internal::Type::Union
82
+ variant -> { Trycourier::ElementalContentSugar }
110
83
 
111
- # Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
112
- variant -> { Trycourier::ElementalContentSugar }
84
+ variant -> { Trycourier::ElementalContent }
113
85
 
114
- variant -> { Trycourier::ElementalContent }
115
-
116
- # @!method self.variants
117
- # @return [Array(Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent)]
118
- end
86
+ # @!method self.variants
87
+ # @return [Array(Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent)]
119
88
  end
120
-
121
- # @!method self.variants
122
- # @return [Array(Trycourier::Models::InboundBulkMessage::InboundBulkTemplateMessage, Trycourier::Models::InboundBulkMessage::InboundBulkContentMessage)]
123
89
  end
124
90
  end
125
91
  end
@@ -4,6 +4,7 @@ module Trycourier
4
4
  module Models
5
5
  class InboundBulkMessageUser < Trycourier::Internal::Type::BaseModel
6
6
  # @!attribute data
7
+ # User-specific data that will be merged with message.data
7
8
  #
8
9
  # @return [Object, nil]
9
10
  optional :data, Trycourier::Internal::Type::Unknown
@@ -14,26 +15,40 @@ module Trycourier
14
15
  optional :preferences, -> { Trycourier::RecipientPreferences }, nil?: true
15
16
 
16
17
  # @!attribute profile
18
+ # User profile information. For email-based bulk jobs, `profile.email` is required
19
+ # for provider routing to determine if the message can be delivered. The email
20
+ # address should be provided here rather than in `to.email`.
17
21
  #
18
- # @return [Object, nil]
19
- optional :profile, Trycourier::Internal::Type::Unknown
22
+ # @return [Hash{Symbol=>Object}, nil]
23
+ optional :profile, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
20
24
 
21
25
  # @!attribute recipient
26
+ # User ID (legacy field, use profile or to.user_id instead)
22
27
  #
23
28
  # @return [String, nil]
24
29
  optional :recipient, String, nil?: true
25
30
 
26
31
  # @!attribute to
32
+ # Optional recipient information. Note: For email provider routing, use
33
+ # `profile.email` instead of `to.email`. The `to` field is primarily used for
34
+ # recipient identification and data merging.
27
35
  #
28
36
  # @return [Trycourier::Models::UserRecipient, nil]
29
37
  optional :to, -> { Trycourier::UserRecipient }, nil?: true
30
38
 
31
39
  # @!method initialize(data: nil, preferences: nil, profile: nil, recipient: nil, to: nil)
32
- # @param data [Object]
40
+ # Some parameter documentations has been truncated, see
41
+ # {Trycourier::Models::InboundBulkMessageUser} for more details.
42
+ #
43
+ # @param data [Object] User-specific data that will be merged with message.data
44
+ #
33
45
  # @param preferences [Trycourier::Models::RecipientPreferences, nil]
34
- # @param profile [Object]
35
- # @param recipient [String, nil]
36
- # @param to [Trycourier::Models::UserRecipient, nil]
46
+ #
47
+ # @param profile [Hash{Symbol=>Object}, nil] User profile information. For email-based bulk jobs, `profile.email` is required
48
+ #
49
+ # @param recipient [String, nil] User ID (legacy field, use profile or to.user_id instead)
50
+ #
51
+ # @param to [Trycourier::Models::UserRecipient, nil] Optional recipient information. Note: For email provider routing, use
37
52
  end
38
53
  end
39
54
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class Intercom < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute from
7
+ #
8
+ # @return [String]
9
+ required :from, String
10
+
11
+ # @!attribute to
12
+ #
13
+ # @return [Trycourier::Models::IntercomRecipient]
14
+ required :to, -> { Trycourier::IntercomRecipient }
15
+
16
+ # @!method initialize(from:, to:)
17
+ # @param from [String]
18
+ # @param to [Trycourier::Models::IntercomRecipient]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class IntercomRecipient < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ #
8
+ # @return [String]
9
+ required :id, String
10
+
11
+ # @!method initialize(id:)
12
+ # @param id [String]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListFilter < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute operator
7
+ # Send to users only if they are member of the account
8
+ #
9
+ # @return [Symbol, Trycourier::Models::ListFilter::Operator]
10
+ required :operator, enum: -> { Trycourier::ListFilter::Operator }
11
+
12
+ # @!attribute path
13
+ #
14
+ # @return [Symbol, Trycourier::Models::ListFilter::Path]
15
+ required :path, enum: -> { Trycourier::ListFilter::Path }
16
+
17
+ # @!attribute value
18
+ #
19
+ # @return [String]
20
+ required :value, String
21
+
22
+ # @!method initialize(operator:, path:, value:)
23
+ # @param operator [Symbol, Trycourier::Models::ListFilter::Operator] Send to users only if they are member of the account
24
+ #
25
+ # @param path [Symbol, Trycourier::Models::ListFilter::Path]
26
+ #
27
+ # @param value [String]
28
+
29
+ # Send to users only if they are member of the account
30
+ #
31
+ # @see Trycourier::Models::ListFilter#operator
32
+ module Operator
33
+ extend Trycourier::Internal::Type::Enum
34
+
35
+ MEMBER_OF = :MEMBER_OF
36
+
37
+ # @!method self.values
38
+ # @return [Array<Symbol>]
39
+ end
40
+
41
+ # @see Trycourier::Models::ListFilter#path
42
+ module Path
43
+ extend Trycourier::Internal::Type::Enum
44
+
45
+ ACCOUNT_ID = :account_id
46
+
47
+ # @!method self.values
48
+ # @return [Array<Symbol>]
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListPatternRecipient < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute data
7
+ #
8
+ # @return [Hash{Symbol=>Object}, nil]
9
+ optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
10
+
11
+ # @!attribute list_pattern
12
+ #
13
+ # @return [String, nil]
14
+ optional :list_pattern, String, nil?: true
15
+
16
+ # @!method initialize(data: nil, list_pattern: nil)
17
+ # Send to users in lists matching a pattern
18
+ #
19
+ # @param data [Hash{Symbol=>Object}, nil]
20
+ # @param list_pattern [String, nil]
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class ListRecipient < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute data
7
+ #
8
+ # @return [Hash{Symbol=>Object}, nil]
9
+ optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true
10
+
11
+ # @!attribute filters
12
+ #
13
+ # @return [Array<Trycourier::Models::ListFilter>, nil]
14
+ optional :filters, -> { Trycourier::Internal::Type::ArrayOf[Trycourier::ListFilter] }, nil?: true
15
+
16
+ # @!attribute list_id
17
+ #
18
+ # @return [String, nil]
19
+ optional :list_id, String, nil?: true
20
+
21
+ # @!method initialize(data: nil, filters: nil, list_id: nil)
22
+ # Send to all users in a specific list
23
+ #
24
+ # @param data [Hash{Symbol=>Object}, nil]
25
+ # @param filters [Array<Trycourier::Models::ListFilter>, nil]
26
+ # @param list_id [String, nil]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ module MsTeams
6
+ extend Trycourier::Internal::Type::Union
7
+
8
+ variant -> { Trycourier::SendToMsTeamsUserID }
9
+
10
+ variant -> { Trycourier::SendToMsTeamsEmail }
11
+
12
+ variant -> { Trycourier::SendToMsTeamsChannelID }
13
+
14
+ variant -> { Trycourier::SendToMsTeamsConversationID }
15
+
16
+ variant -> { Trycourier::SendToMsTeamsChannelName }
17
+
18
+ # @!method self.variants
19
+ # @return [Array(Trycourier::Models::SendToMsTeamsUserID, Trycourier::Models::SendToMsTeamsEmail, Trycourier::Models::SendToMsTeamsChannelID, Trycourier::Models::SendToMsTeamsConversationID, Trycourier::Models::SendToMsTeamsChannelName)]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MsTeamsBaseProperties < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute service_url
7
+ #
8
+ # @return [String]
9
+ required :service_url, String
10
+
11
+ # @!attribute tenant_id
12
+ #
13
+ # @return [String]
14
+ required :tenant_id, String
15
+
16
+ # @!method initialize(service_url:, tenant_id:)
17
+ # @param service_url [String]
18
+ # @param tenant_id [String]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MsTeamsRecipient < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute ms_teams
7
+ #
8
+ # @return [Trycourier::Models::SendToMsTeamsUserID, Trycourier::Models::SendToMsTeamsEmail, Trycourier::Models::SendToMsTeamsChannelID, Trycourier::Models::SendToMsTeamsConversationID, Trycourier::Models::SendToMsTeamsChannelName]
9
+ required :ms_teams, union: -> { Trycourier::MsTeams }
10
+
11
+ # @!method initialize(ms_teams:)
12
+ # Send via Microsoft Teams
13
+ #
14
+ # @param ms_teams [Trycourier::Models::SendToMsTeamsUserID, Trycourier::Models::SendToMsTeamsEmail, Trycourier::Models::SendToMsTeamsChannelID, Trycourier::Models::SendToMsTeamsConversationID, Trycourier::Models::SendToMsTeamsChannelName]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class MultipleTokens < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute tokens
7
+ #
8
+ # @return [Array<Trycourier::Models::Token>]
9
+ required :tokens, -> { Trycourier::Internal::Type::ArrayOf[Trycourier::Token] }
10
+
11
+ # @!method initialize(tokens:)
12
+ # @param tokens [Array<Trycourier::Models::Token>]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class NestedFilterConfig < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute operator
7
+ # The operator to use for filtering
8
+ #
9
+ # @return [Symbol, Trycourier::Models::NestedFilterConfig::Operator]
10
+ required :operator, enum: -> { Trycourier::NestedFilterConfig::Operator }
11
+
12
+ # @!attribute rules
13
+ #
14
+ # @return [Array<Trycourier::Models::FilterConfig>]
15
+ required :rules, -> { Trycourier::Internal::Type::ArrayOf[union: Trycourier::FilterConfig] }
16
+
17
+ # @!method initialize(operator:, rules:)
18
+ # @param operator [Symbol, Trycourier::Models::NestedFilterConfig::Operator] The operator to use for filtering
19
+ #
20
+ # @param rules [Array<Trycourier::Models::FilterConfig>]
21
+
22
+ # The operator to use for filtering
23
+ #
24
+ # @see Trycourier::Models::NestedFilterConfig#operator
25
+ module Operator
26
+ extend Trycourier::Internal::Type::Enum
27
+
28
+ ENDS_WITH = :ENDS_WITH
29
+ EQ = :EQ
30
+ EXISTS = :EXISTS
31
+ GT = :GT
32
+ GTE = :GTE
33
+ INCLUDES = :INCLUDES
34
+ IS_AFTER = :IS_AFTER
35
+ IS_BEFORE = :IS_BEFORE
36
+ LT = :LT
37
+ LTE = :LTE
38
+ NEQ = :NEQ
39
+ OMIT = :OMIT
40
+ STARTS_WITH = :STARTS_WITH
41
+ AND = :AND
42
+ OR = :OR
43
+
44
+ # @!method self.values
45
+ # @return [Array<Symbol>]
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class Pagerduty < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute event_action
7
+ #
8
+ # @return [String, nil]
9
+ optional :event_action, String, nil?: true
10
+
11
+ # @!attribute routing_key
12
+ #
13
+ # @return [String, nil]
14
+ optional :routing_key, String, nil?: true
15
+
16
+ # @!attribute severity
17
+ #
18
+ # @return [String, nil]
19
+ optional :severity, String, nil?: true
20
+
21
+ # @!attribute source
22
+ #
23
+ # @return [String, nil]
24
+ optional :source, String, nil?: true
25
+
26
+ # @!method initialize(event_action: nil, routing_key: nil, severity: nil, source: nil)
27
+ # @param event_action [String, nil]
28
+ # @param routing_key [String, nil]
29
+ # @param severity [String, nil]
30
+ # @param source [String, nil]
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class PagerdutyRecipient < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute pagerduty
7
+ #
8
+ # @return [Trycourier::Models::Pagerduty]
9
+ required :pagerduty, -> { Trycourier::Pagerduty }
10
+
11
+ # @!method initialize(pagerduty:)
12
+ # Send via PagerDuty
13
+ #
14
+ # @param pagerduty [Trycourier::Models::Pagerduty]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Trycourier
4
+ module Models
5
+ class SendDirectMessage < Trycourier::Internal::Type::BaseModel
6
+ # @!attribute user_id
7
+ #
8
+ # @return [String]
9
+ required :user_id, String
10
+
11
+ # @!method initialize(user_id:)
12
+ # @param user_id [String]
13
+ end
14
+ end
15
+ end