trycourier 4.9.0 → 4.10.1

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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/lib/courier/internal/util.rb +3 -1
  4. data/lib/courier/models/associated_notification_list_response.rb +24 -0
  5. data/lib/courier/models/element_with_checksums.rb +60 -0
  6. data/lib/courier/models/notification_content_get_response.rb +26 -0
  7. data/lib/courier/models/notification_content_mutation_response.rb +61 -0
  8. data/lib/courier/models/notification_content_put_request.rb +51 -0
  9. data/lib/courier/models/notification_element_put_request.rb +62 -0
  10. data/lib/courier/models/notification_get_content.rb +0 -1
  11. data/lib/courier/models/notification_locale_put_request.rb +39 -0
  12. data/lib/courier/models/notification_put_content_params.rb +20 -0
  13. data/lib/courier/models/notification_put_element_params.rb +26 -0
  14. data/lib/courier/models/notification_put_locale_params.rb +26 -0
  15. data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
  16. data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
  17. data/lib/courier/models/notification_template_get_response.rb +1 -1
  18. data/lib/courier/models/notification_template_state.rb +16 -0
  19. data/lib/courier/models/provider_update_params.rb +3 -2
  20. data/lib/courier/models/routing_strategy_get_response.rb +1 -1
  21. data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
  22. data/lib/courier/models.rb +24 -4
  23. data/lib/courier/resources/notifications.rb +128 -13
  24. data/lib/courier/resources/providers.rb +7 -5
  25. data/lib/courier/resources/routing_strategies.rb +32 -4
  26. data/lib/courier/version.rb +1 -1
  27. data/lib/courier.rb +13 -4
  28. data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
  29. data/rbi/courier/models/element_with_checksums.rbi +109 -0
  30. data/rbi/courier/models/notification_content_get_response.rbi +45 -0
  31. data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
  32. data/rbi/courier/models/notification_content_put_request.rbi +145 -0
  33. data/rbi/courier/models/notification_element_put_request.rbi +98 -0
  34. data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
  35. data/rbi/courier/models/notification_put_content_params.rbi +38 -0
  36. data/rbi/courier/models/notification_put_element_params.rbi +46 -0
  37. data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
  38. data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
  39. data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
  40. data/rbi/courier/models/notification_template_state.rbi +26 -0
  41. data/rbi/courier/models/provider_update_params.rbi +4 -2
  42. data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
  43. data/rbi/courier/models.rbi +28 -6
  44. data/rbi/courier/resources/notifications.rbi +105 -7
  45. data/rbi/courier/resources/providers.rbi +7 -4
  46. data/rbi/courier/resources/routing_strategies.rbi +23 -2
  47. data/sig/courier/models/associated_notification_list_response.rbs +25 -0
  48. data/sig/courier/models/element_with_checksums.rbs +60 -0
  49. data/sig/courier/models/notification_content_get_response.rbs +22 -0
  50. data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
  51. data/sig/courier/models/notification_content_put_request.rbs +50 -0
  52. data/sig/courier/models/notification_element_put_request.rbs +64 -0
  53. data/sig/courier/models/notification_locale_put_request.rbs +39 -0
  54. data/sig/courier/models/notification_put_content_params.rbs +22 -0
  55. data/sig/courier/models/notification_put_element_params.rbs +32 -0
  56. data/sig/courier/models/notification_put_locale_params.rbs +32 -0
  57. data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
  58. data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
  59. data/sig/courier/models/notification_template_state.rbs +14 -0
  60. data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
  61. data/sig/courier/models.rbs +24 -4
  62. data/sig/courier/resources/notifications.rbs +32 -5
  63. data/sig/courier/resources/routing_strategies.rbs +9 -2
  64. metadata +41 -14
  65. data/lib/courier/models/notification_template_mutation_response.rb +0 -51
  66. data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
  67. data/lib/courier/models/routing_strategy_mutation_response.rb +0 -19
  68. data/lib/courier/resources/notifications/draft.rb +0 -33
  69. data/rbi/courier/models/notification_template_mutation_response.rbi +0 -121
  70. data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
  71. data/rbi/courier/models/routing_strategy_mutation_response.rbi +0 -31
  72. data/rbi/courier/resources/notifications/draft.rbi +0 -23
  73. data/sig/courier/models/notification_template_mutation_response.rbs +0 -46
  74. data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
  75. data/sig/courier/models/routing_strategy_mutation_response.rbs +0 -13
  76. data/sig/courier/resources/notifications/draft.rbs +0 -14
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::RoutingStrategies#create
6
- class RoutingStrategyMutationResponse < Courier::Internal::Type::BaseModel
7
- # @!attribute id
8
- # The routing strategy ID (rs\_ prefix).
9
- #
10
- # @return [String]
11
- required :id, String
12
-
13
- # @!method initialize(id:)
14
- # Response returned by create and replace operations.
15
- #
16
- # @param id [String] The routing strategy ID (rs\_ prefix).
17
- end
18
- end
19
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Resources
5
- class Notifications
6
- class Draft
7
- # @overload retrieve_content(id, request_options: {})
8
- #
9
- # @param id [String]
10
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
11
- #
12
- # @return [Courier::Models::NotificationGetContent]
13
- #
14
- # @see Courier::Models::Notifications::DraftRetrieveContentParams
15
- def retrieve_content(id, params = {})
16
- @client.request(
17
- method: :get,
18
- path: ["notifications/%1$s/draft/content", id],
19
- model: Courier::NotificationGetContent,
20
- options: params[:request_options]
21
- )
22
- end
23
-
24
- # @api private
25
- #
26
- # @param client [Courier::Client]
27
- def initialize(client:)
28
- @client = client
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,121 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Models
5
- class NotificationTemplateMutationResponse < Courier::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(
9
- Courier::NotificationTemplateMutationResponse,
10
- Courier::Internal::AnyHash
11
- )
12
- end
13
-
14
- sig do
15
- returns(Courier::NotificationTemplateMutationResponse::Notification)
16
- end
17
- attr_reader :notification
18
-
19
- sig do
20
- params(
21
- notification:
22
- Courier::NotificationTemplateMutationResponse::Notification::OrHash
23
- ).void
24
- end
25
- attr_writer :notification
26
-
27
- # The template state after the operation. Always uppercase.
28
- sig do
29
- returns(
30
- Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
31
- )
32
- end
33
- attr_accessor :state
34
-
35
- # Response returned by POST and PUT operations.
36
- sig do
37
- params(
38
- notification:
39
- Courier::NotificationTemplateMutationResponse::Notification::OrHash,
40
- state: Courier::NotificationTemplateMutationResponse::State::OrSymbol
41
- ).returns(T.attached_class)
42
- end
43
- def self.new(
44
- notification:,
45
- # The template state after the operation. Always uppercase.
46
- state:
47
- )
48
- end
49
-
50
- sig do
51
- override.returns(
52
- {
53
- notification:
54
- Courier::NotificationTemplateMutationResponse::Notification,
55
- state:
56
- Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
57
- }
58
- )
59
- end
60
- def to_hash
61
- end
62
-
63
- class Notification < Courier::Internal::Type::BaseModel
64
- OrHash =
65
- T.type_alias do
66
- T.any(
67
- Courier::NotificationTemplateMutationResponse::Notification,
68
- Courier::Internal::AnyHash
69
- )
70
- end
71
-
72
- # The ID of the created or updated template.
73
- sig { returns(String) }
74
- attr_accessor :id
75
-
76
- sig { params(id: String).returns(T.attached_class) }
77
- def self.new(
78
- # The ID of the created or updated template.
79
- id:
80
- )
81
- end
82
-
83
- sig { override.returns({ id: String }) }
84
- def to_hash
85
- end
86
- end
87
-
88
- # The template state after the operation. Always uppercase.
89
- module State
90
- extend Courier::Internal::Type::Enum
91
-
92
- TaggedSymbol =
93
- T.type_alias do
94
- T.all(Symbol, Courier::NotificationTemplateMutationResponse::State)
95
- end
96
- OrSymbol = T.type_alias { T.any(Symbol, String) }
97
-
98
- DRAFT =
99
- T.let(
100
- :DRAFT,
101
- Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
102
- )
103
- PUBLISHED =
104
- T.let(
105
- :PUBLISHED,
106
- Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
107
- )
108
-
109
- sig do
110
- override.returns(
111
- T::Array[
112
- Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
113
- ]
114
- )
115
- end
116
- def self.values
117
- end
118
- end
119
- end
120
- end
121
- end
@@ -1,40 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Models
5
- module Notifications
6
- class DraftRetrieveContentParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Courier::Notifications::DraftRetrieveContentParams,
14
- Courier::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :id
20
-
21
- sig do
22
- params(
23
- id: String,
24
- request_options: Courier::RequestOptions::OrHash
25
- ).returns(T.attached_class)
26
- end
27
- def self.new(id:, request_options: {})
28
- end
29
-
30
- sig do
31
- override.returns(
32
- { id: String, request_options: Courier::RequestOptions }
33
- )
34
- end
35
- def to_hash
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,31 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Models
5
- class RoutingStrategyMutationResponse < Courier::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(
9
- Courier::RoutingStrategyMutationResponse,
10
- Courier::Internal::AnyHash
11
- )
12
- end
13
-
14
- # The routing strategy ID (rs\_ prefix).
15
- sig { returns(String) }
16
- attr_accessor :id
17
-
18
- # Response returned by create and replace operations.
19
- sig { params(id: String).returns(T.attached_class) }
20
- def self.new(
21
- # The routing strategy ID (rs\_ prefix).
22
- id:
23
- )
24
- end
25
-
26
- sig { override.returns({ id: String }) }
27
- def to_hash
28
- end
29
- end
30
- end
31
- end
@@ -1,23 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Resources
5
- class Notifications
6
- class Draft
7
- sig do
8
- params(
9
- id: String,
10
- request_options: Courier::RequestOptions::OrHash
11
- ).returns(Courier::NotificationGetContent)
12
- end
13
- def retrieve_content(id, request_options: {})
14
- end
15
-
16
- # @api private
17
- sig { params(client: Courier::Client).returns(T.attached_class) }
18
- def self.new(client:)
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,46 +0,0 @@
1
- module Courier
2
- module Models
3
- type notification_template_mutation_response =
4
- {
5
- notification: Courier::NotificationTemplateMutationResponse::Notification,
6
- state: Courier::Models::NotificationTemplateMutationResponse::state
7
- }
8
-
9
- class NotificationTemplateMutationResponse < Courier::Internal::Type::BaseModel
10
- attr_accessor notification: Courier::NotificationTemplateMutationResponse::Notification
11
-
12
- attr_accessor state: Courier::Models::NotificationTemplateMutationResponse::state
13
-
14
- def initialize: (
15
- notification: Courier::NotificationTemplateMutationResponse::Notification,
16
- state: Courier::Models::NotificationTemplateMutationResponse::state
17
- ) -> void
18
-
19
- def to_hash: -> {
20
- notification: Courier::NotificationTemplateMutationResponse::Notification,
21
- state: Courier::Models::NotificationTemplateMutationResponse::state
22
- }
23
-
24
- type notification = { id: String }
25
-
26
- class Notification < Courier::Internal::Type::BaseModel
27
- attr_accessor id: String
28
-
29
- def initialize: (id: String) -> void
30
-
31
- def to_hash: -> { id: String }
32
- end
33
-
34
- type state = :DRAFT | :PUBLISHED
35
-
36
- module State
37
- extend Courier::Internal::Type::Enum
38
-
39
- DRAFT: :DRAFT
40
- PUBLISHED: :PUBLISHED
41
-
42
- def self?.values: -> ::Array[Courier::Models::NotificationTemplateMutationResponse::state]
43
- end
44
- end
45
- end
46
- end
@@ -1,22 +0,0 @@
1
- module Courier
2
- module Models
3
- module Notifications
4
- type draft_retrieve_content_params =
5
- { id: String } & Courier::Internal::Type::request_parameters
6
-
7
- class DraftRetrieveContentParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor id: String
12
-
13
- def initialize: (
14
- id: String,
15
- ?request_options: Courier::request_opts
16
- ) -> void
17
-
18
- def to_hash: -> { id: String, request_options: Courier::RequestOptions }
19
- end
20
- end
21
- end
22
- end
@@ -1,13 +0,0 @@
1
- module Courier
2
- module Models
3
- type routing_strategy_mutation_response = { id: String }
4
-
5
- class RoutingStrategyMutationResponse < Courier::Internal::Type::BaseModel
6
- attr_accessor id: String
7
-
8
- def initialize: (id: String) -> void
9
-
10
- def to_hash: -> { id: String }
11
- end
12
- end
13
- end
@@ -1,14 +0,0 @@
1
- module Courier
2
- module Resources
3
- class Notifications
4
- class Draft
5
- def retrieve_content: (
6
- String id,
7
- ?request_options: Courier::request_opts
8
- ) -> Courier::NotificationGetContent
9
-
10
- def initialize: (client: Courier::Client) -> void
11
- end
12
- end
13
- end
14
- end