sentdm 0.32.0 → 0.34.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +6 -0
  5. data/lib/sentdm/models/channel_event_payload.rb +154 -7
  6. data/lib/sentdm/models/contact_event.rb +15 -7
  7. data/lib/sentdm/models/contact_event_payload.rb +77 -16
  8. data/lib/sentdm/models/conversation_messages_list.rb +214 -6
  9. data/lib/sentdm/models/inbound_message_event_payload.rb +70 -3
  10. data/lib/sentdm/models/me_retrieve_response.rb +21 -1
  11. data/lib/sentdm/models/message_event_payload.rb +42 -1
  12. data/lib/sentdm/models/message_retrieve_activities_response.rb +42 -5
  13. data/lib/sentdm/models/message_retrieve_status_response.rb +222 -8
  14. data/lib/sentdm/models/message_send_params.rb +67 -3
  15. data/lib/sentdm/models/message_send_response.rb +13 -4
  16. data/lib/sentdm/models/template_body.rb +82 -1
  17. data/lib/sentdm/models/template_create_params.rb +11 -1
  18. data/lib/sentdm/models/template_header.rb +91 -3
  19. data/lib/sentdm/models/template_variable.rb +15 -1
  20. data/lib/sentdm/models/webhook_create_params.rb +31 -1
  21. data/lib/sentdm/models/webhook_list_events_response.rb +497 -9
  22. data/lib/sentdm/models/webhook_update_params.rb +31 -1
  23. data/lib/sentdm/resources/me.rb +5 -0
  24. data/lib/sentdm/resources/messages.rb +33 -5
  25. data/lib/sentdm/resources/templates.rb +3 -1
  26. data/lib/sentdm/resources/webhooks.rb +9 -3
  27. data/lib/sentdm/version.rb +1 -1
  28. data/lib/sentdm.rb +1 -1
  29. data/rbi/sentdm/client.rbi +6 -0
  30. data/rbi/sentdm/models/channel_event_payload.rbi +273 -10
  31. data/rbi/sentdm/models/contact_event.rbi +28 -12
  32. data/rbi/sentdm/models/contact_event_payload.rbi +118 -28
  33. data/rbi/sentdm/models/conversation_messages_list.rbi +308 -10
  34. data/rbi/sentdm/models/inbound_message_event_payload.rbi +110 -2
  35. data/rbi/sentdm/models/me_retrieve_response.rbi +35 -0
  36. data/rbi/sentdm/models/message_event_payload.rbi +50 -0
  37. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +49 -5
  38. data/rbi/sentdm/models/message_retrieve_status_response.rbi +320 -12
  39. data/rbi/sentdm/models/message_send_params.rbi +100 -2
  40. data/rbi/sentdm/models/message_send_response.rbi +15 -5
  41. data/rbi/sentdm/models/template_body.rbi +133 -0
  42. data/rbi/sentdm/models/template_create_params.rbi +15 -0
  43. data/rbi/sentdm/models/template_header.rbi +143 -2
  44. data/rbi/sentdm/models/template_variable.rbi +10 -0
  45. data/rbi/sentdm/models/webhook_create_params.rbi +61 -0
  46. data/rbi/sentdm/models/webhook_list_events_response.rbi +747 -12
  47. data/rbi/sentdm/models/webhook_update_params.rbi +61 -0
  48. data/rbi/sentdm/resources/me.rbi +5 -0
  49. data/rbi/sentdm/resources/messages.rbi +58 -3
  50. data/rbi/sentdm/resources/templates.rbi +6 -0
  51. data/rbi/sentdm/resources/webhooks.rbi +15 -1
  52. data/sig/sentdm/models/channel_event_payload.rbs +62 -0
  53. data/sig/sentdm/models/contact_event_payload.rbs +24 -9
  54. data/sig/sentdm/models/conversation_messages_list.rbs +99 -6
  55. data/sig/sentdm/models/inbound_message_event_payload.rbs +37 -0
  56. data/sig/sentdm/models/me_retrieve_response.rbs +7 -0
  57. data/sig/sentdm/models/message_event_payload.rbs +20 -0
  58. data/sig/sentdm/models/message_retrieve_activities_response.rbs +15 -0
  59. data/sig/sentdm/models/message_retrieve_status_response.rbs +99 -6
  60. data/sig/sentdm/models/message_send_params.rbs +15 -0
  61. data/sig/sentdm/models/template_body.rbs +44 -0
  62. data/sig/sentdm/models/template_create_params.rbs +7 -0
  63. data/sig/sentdm/models/template_header.rbs +44 -0
  64. data/sig/sentdm/models/webhook_create_params.rbs +29 -0
  65. data/sig/sentdm/models/webhook_list_events_response.rbs +252 -0
  66. data/sig/sentdm/models/webhook_update_params.rbs +29 -0
  67. data/sig/sentdm/resources/messages.rbs +3 -0
  68. data/sig/sentdm/resources/templates.rbs +1 -0
  69. data/sig/sentdm/resources/webhooks.rbs +2 -0
  70. metadata +2 -2
@@ -10,8 +10,56 @@ module Sentdm
10
10
  # @return [String]
11
11
  required :template, String
12
12
 
13
+ # @!attribute example_url
14
+ # Request-only. The s.dm URL of the asset Meta's reviewers see —
15
+ # https://s.dm/s/{ID}, eight uppercase characters, uploaded to s.dm out of band.
16
+ # NormalizeRichHeader folds it into the synthesized media variable's Props.Sample
17
+ # and clears it, so it never persists and a stored definition is indistinguishable
18
+ # from an imported one.
19
+ #
20
+ # Stricter than the send path on purpose:
21
+ # TemplateUtils.ValidateMediaVariableValues accepts any absolute https URL for the
22
+ # per-send asset, because that one is the customer's and may live behind a signed
23
+ # CDN link. This one is the review sample, has to outlive every resubmission, and
24
+ # so must be ours. Do not "fix" one to match the other.
25
+ #
26
+ # @return [String, nil]
27
+ optional :example_url, String, nil?: true
28
+
29
+ # @!attribute location
30
+ # The map pin a location header drops. Meta wants none of this at creation — the
31
+ # component is just {"type":"header","format":"location"} — so these values exist
32
+ # for Sent: a preview, and the default a StaticResource header falls back to at
33
+ # send.
34
+ #
35
+ # @return [Sentdm::Models::TemplateHeader::Location, nil]
36
+ optional :location, -> { Sentdm::TemplateHeader::Location }, nil?: true
37
+
38
+ # @!attribute static_resource
39
+ # Whether the asset registered at creation is reused when a caller omits the
40
+ # header's variable at send time. Default false — the caller must supply it per
41
+ # message, which is the behaviour every existing template has. Written only when
42
+ # true, so a default-valued header serializes byte-identically to one imported
43
+ # from Meta.
44
+ #
45
+ # Stored and validated but not yet honoured at send: that lands with the Resumable
46
+ # Upload work, alongside the code that lets such a template be approved in the
47
+ # first place.
48
+ #
49
+ # @return [Boolean, nil]
50
+ optional :static_resource, Sentdm::Internal::Type::Boolean
51
+
13
52
  # @!attribute type
14
- # The type of header (e.g., "text", "image", "video", "document")
53
+ # The kind of header. One of:
54
+ #
55
+ # text — up to 60 characters, at most one variable. image — png, jpg or jpeg.
56
+ # Needs ExampleUrl. video — mp4. Needs ExampleUrl. gif — mp4, max 3.5MB. WhatsApp
57
+ # renders larger files as an ordinary video. Needs ExampleUrl. document — pdf or
58
+ # docx; only the first page is shown as a thumbnail, so pdf is the practical
59
+ # choice. Needs ExampleUrl. location — a map pin, supplied through Location.
60
+ #
61
+ # Kept lowercase because MetaToTemplateConverter writes Meta's format through
62
+ # ToLowerInvariant() into this field on import, and the two are compared directly.
15
63
  #
16
64
  # @return [String, nil]
17
65
  optional :type, String, nil?: true
@@ -22,7 +70,7 @@ module Sentdm
22
70
  # @return [Array<Sentdm::Models::TemplateVariable>, nil]
23
71
  optional :variables, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::TemplateVariable] }, nil?: true
24
72
 
25
- # @!method initialize(template:, type: nil, variables: nil)
73
+ # @!method initialize(template:, example_url: nil, location: nil, static_resource: nil, type: nil, variables: nil)
26
74
  # Some parameter documentations has been truncated, see
27
75
  # {Sentdm::Models::TemplateHeader} for more details.
28
76
  #
@@ -30,9 +78,49 @@ module Sentdm
30
78
  #
31
79
  # @param template [String] The header template text with optional variable placeholders (e.g., "Welcome to
32
80
  #
33
- # @param type [String, nil] The type of header (e.g., "text", "image", "video", "document")
81
+ # @param example_url [String, nil] Request-only. The s.dm URL of the asset Meta's reviewers see — https://s.dm/s/{I
82
+ #
83
+ # @param location [Sentdm::Models::TemplateHeader::Location, nil] The map pin a location header drops. Meta wants none of this at creation — the c
84
+ #
85
+ # @param static_resource [Boolean] Whether the asset registered at creation is reused when a caller omits the heade
86
+ #
87
+ # @param type [String, nil] The kind of header. One of:
34
88
  #
35
89
  # @param variables [Array<Sentdm::Models::TemplateVariable>, nil] List of variables used in the header template
90
+
91
+ # @see Sentdm::Models::TemplateHeader#location
92
+ class Location < Sentdm::Internal::Type::BaseModel
93
+ # @!attribute address
94
+ #
95
+ # @return [String]
96
+ required :address, String
97
+
98
+ # @!attribute latitude
99
+ #
100
+ # @return [String]
101
+ required :latitude, String
102
+
103
+ # @!attribute longitude
104
+ #
105
+ # @return [String]
106
+ required :longitude, String
107
+
108
+ # @!attribute name
109
+ #
110
+ # @return [String]
111
+ required :name, String
112
+
113
+ # @!method initialize(address:, latitude:, longitude:, name:)
114
+ # The map pin a location header drops. Meta wants none of this at creation — the
115
+ # component is just {"type":"header","format":"location"} — so these values exist
116
+ # for Sent: a preview, and the default a StaticResource header falls back to at
117
+ # send.
118
+ #
119
+ # @param address [String]
120
+ # @param latitude [String]
121
+ # @param longitude [String]
122
+ # @param name [String]
123
+ end
36
124
  end
37
125
  end
38
126
  end
@@ -54,6 +54,11 @@ module Sentdm
54
54
  required :media_type, String, api_name: :mediaType
55
55
 
56
56
  # @!attribute sample
57
+ # Example value substituted into the template when previewing it and when
58
+ # submitting it to Meta for review. Free text by nature, so the converter accepts
59
+ # a JSON number or boolean here and normalizes it — see
60
+ # JsonScalarToStringConverter for why — and guarantees it is always serialized
61
+ # back out as a JSON string.
57
62
  #
58
63
  # @return [String]
59
64
  required :sample, String
@@ -84,12 +89,21 @@ module Sentdm
84
89
  optional :short_url, String, api_name: :shortUrl, nil?: true
85
90
 
86
91
  # @!method initialize(media_type:, sample:, url:, variable_type:, alt: nil, regex: nil, short_url: nil)
92
+ # Some parameter documentations has been truncated, see
93
+ # {Sentdm::Models::TemplateVariable::Props} for more details.
94
+ #
87
95
  # @param media_type [String]
88
- # @param sample [String]
96
+ #
97
+ # @param sample [String] Example value substituted into the template when previewing it and when submitti
98
+ #
89
99
  # @param url [String]
100
+ #
90
101
  # @param variable_type [String]
102
+ #
91
103
  # @param alt [String, nil]
104
+ #
92
105
  # @param regex [String, nil]
106
+ #
93
107
  # @param short_url [String, nil]
94
108
  end
95
109
  end
@@ -41,6 +41,13 @@ module Sentdm
41
41
  # @return [Boolean, nil]
42
42
  optional :sandbox, Sentdm::Internal::Type::Boolean
43
43
 
44
+ # @!attribute sender_profile
45
+ # Request-only: the events an organization webhook's sender profile clones
46
+ # receive, one clone per existing and future profile. Responses never return it.
47
+ #
48
+ # @return [Sentdm::Models::WebhookCreateParams::SenderProfile, nil]
49
+ optional :sender_profile, -> { Sentdm::WebhookCreateParams::SenderProfile }, nil?: true
50
+
44
51
  # @!attribute timeout_seconds
45
52
  #
46
53
  # @return [Integer, nil]
@@ -56,7 +63,7 @@ module Sentdm
56
63
  # @return [String, nil]
57
64
  optional :x_profile_id, String
58
65
 
59
- # @!method initialize(display_name: nil, endpoint_url: nil, event_filters: nil, event_types: nil, retry_count: nil, sandbox: nil, timeout_seconds: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
66
+ # @!method initialize(display_name: nil, endpoint_url: nil, event_filters: nil, event_types: nil, retry_count: nil, sandbox: nil, sender_profile: nil, timeout_seconds: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
60
67
  # Some parameter documentations has been truncated, see
61
68
  # {Sentdm::Models::WebhookCreateParams} for more details.
62
69
  #
@@ -72,6 +79,8 @@ module Sentdm
72
79
  #
73
80
  # @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
74
81
  #
82
+ # @param sender_profile [Sentdm::Models::WebhookCreateParams::SenderProfile, nil] Request-only: the events an organization webhook's sender profile clones receive
83
+ #
75
84
  # @param timeout_seconds [Integer]
76
85
  #
77
86
  # @param idempotency_key [String]
@@ -79,6 +88,27 @@ module Sentdm
79
88
  # @param x_profile_id [String]
80
89
  #
81
90
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
91
+
92
+ class SenderProfile < Sentdm::Internal::Type::BaseModel
93
+ # @!attribute event_filters
94
+ #
95
+ # @return [Hash{Symbol=>Array<String>}, nil]
96
+ optional :event_filters,
97
+ Sentdm::Internal::Type::HashOf[Sentdm::Internal::Type::ArrayOf[String]],
98
+ nil?: true
99
+
100
+ # @!attribute event_types
101
+ #
102
+ # @return [Array<String>, nil]
103
+ optional :event_types, Sentdm::Internal::Type::ArrayOf[String]
104
+
105
+ # @!method initialize(event_filters: nil, event_types: nil)
106
+ # Request-only: the events an organization webhook's sender profile clones
107
+ # receive, one clone per existing and future profile. Responses never return it.
108
+ #
109
+ # @param event_filters [Hash{Symbol=>Array<String>}, nil]
110
+ # @param event_types [Array<String>]
111
+ end
82
112
  end
83
113
  end
84
114
  end