rcs 2.0.15 → 2.0.16.pre.rc.2

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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -3
  3. data/.rubocop.yml +14 -1
  4. data/lib/pinnacle/brands/client.rb +3 -3
  5. data/lib/pinnacle/campaigns/dlc/client.rb +2 -2
  6. data/lib/pinnacle/campaigns/rcs/client.rb +2 -2
  7. data/lib/pinnacle/campaigns/toll_free/client.rb +2 -2
  8. data/lib/pinnacle/client.rb +6 -1
  9. data/lib/pinnacle/conversations/client.rb +1 -1
  10. data/lib/pinnacle/forms/client.rb +217 -0
  11. data/lib/pinnacle/forms/submissions/client.rb +56 -0
  12. data/lib/pinnacle/forms/submissions/types/list_form_submissions_params.rb +15 -0
  13. data/lib/pinnacle/forms/types/forms_send_response.rb +14 -0
  14. data/lib/pinnacle/forms/types/list_forms_params.rb +12 -0
  15. data/lib/pinnacle/forms/types/update_form_params.rb +18 -0
  16. data/lib/pinnacle/internal/http/base_request.rb +14 -0
  17. data/lib/pinnacle/internal/http/raw_client.rb +21 -3
  18. data/lib/pinnacle/internal/json/request.rb +6 -4
  19. data/lib/pinnacle/internal/multipart/multipart_request.rb +6 -4
  20. data/lib/pinnacle/internal/types/union.rb +1 -1
  21. data/lib/pinnacle/internal/types/utils.rb +2 -2
  22. data/lib/pinnacle/messages/client.rb +1 -1
  23. data/lib/pinnacle/messages/schedule/client.rb +1 -1
  24. data/lib/pinnacle/rcs/client.rb +1 -1
  25. data/lib/pinnacle/rcs/test/client.rb +3 -3
  26. data/lib/pinnacle/status/get/client.rb +5 -5
  27. data/lib/pinnacle/tools/url/client.rb +2 -2
  28. data/lib/pinnacle/types/address_field.rb +14 -0
  29. data/lib/pinnacle/types/attach_webhook_response_webhook.rb +1 -0
  30. data/lib/pinnacle/types/checkbox_field.rb +13 -0
  31. data/lib/pinnacle/types/color_field.rb +8 -0
  32. data/lib/pinnacle/types/create_form_request.rb +23 -0
  33. data/lib/pinnacle/types/date_field.rb +12 -0
  34. data/lib/pinnacle/types/datetime_field.rb +12 -0
  35. data/lib/pinnacle/types/email_field.rb +10 -0
  36. data/lib/pinnacle/types/extended_brand_with_vetting.rb +2 -2
  37. data/lib/pinnacle/types/field_base.rb +14 -0
  38. data/lib/pinnacle/types/form.rb +22 -0
  39. data/lib/pinnacle/types/form_background.rb +17 -0
  40. data/lib/pinnacle/types/form_background_gradient.rb +12 -0
  41. data/lib/pinnacle/types/form_background_image.rb +13 -0
  42. data/lib/pinnacle/types/form_background_pattern.rb +10 -0
  43. data/lib/pinnacle/types/form_background_pattern_preset.rb +16 -0
  44. data/lib/pinnacle/types/form_background_solid.rb +34 -0
  45. data/lib/pinnacle/types/form_color_palette.rb +12 -0
  46. data/lib/pinnacle/types/form_definition.rb +15 -0
  47. data/lib/pinnacle/types/form_field.rb +29 -0
  48. data/lib/pinnacle/types/form_field_option.rb +11 -0
  49. data/lib/pinnacle/types/form_gradient.rb +12 -0
  50. data/lib/pinnacle/types/form_gradient_angle.rb +12 -0
  51. data/lib/pinnacle/types/form_id_reference.rb +23 -0
  52. data/lib/pinnacle/types/form_submission.rb +19 -0
  53. data/lib/pinnacle/types/form_submission_answer.rb +20 -0
  54. data/lib/pinnacle/types/form_submission_event.rb +15 -0
  55. data/lib/pinnacle/types/form_submission_event_conversation.rb +20 -0
  56. data/lib/pinnacle/types/form_submission_event_form.rb +12 -0
  57. data/lib/pinnacle/types/form_submission_event_submission.rb +17 -0
  58. data/lib/pinnacle/types/form_submitted_field.rb +13 -0
  59. data/lib/pinnacle/types/form_theme_override.rb +25 -0
  60. data/lib/pinnacle/types/form_theme_override_colors.rb +12 -0
  61. data/lib/pinnacle/types/form_theme_override_content_alignment.rb +13 -0
  62. data/lib/pinnacle/types/form_theme_override_corner_radius.rb +13 -0
  63. data/lib/pinnacle/types/form_theme_override_font_family.rb +15 -0
  64. data/lib/pinnacle/types/form_theme_override_theme_mode.rb +13 -0
  65. data/lib/pinnacle/types/list_form_submissions_response.rb +12 -0
  66. data/lib/pinnacle/types/list_forms_response.rb +12 -0
  67. data/lib/pinnacle/types/number_field.rb +13 -0
  68. data/lib/pinnacle/types/phone_field.rb +11 -0
  69. data/lib/pinnacle/types/radio_field.rb +10 -0
  70. data/lib/pinnacle/types/range_field.rb +12 -0
  71. data/lib/pinnacle/types/rating_field.rb +11 -0
  72. data/lib/pinnacle/types/rcs_cards_content.rb +1 -1
  73. data/lib/pinnacle/types/rcs_cards_content_cards_item.rb +1 -1
  74. data/lib/pinnacle/types/rcs_media_content.rb +1 -1
  75. data/lib/pinnacle/types/rcs_validate_content_media.rb +1 -1
  76. data/lib/pinnacle/types/rich_card.rb +1 -1
  77. data/lib/pinnacle/types/rich_cards.rb +1 -1
  78. data/lib/pinnacle/types/rich_media_message.rb +1 -1
  79. data/lib/pinnacle/types/rich_text.rb +1 -1
  80. data/lib/pinnacle/types/scheduled_form_send_response_form.rb +10 -0
  81. data/lib/pinnacle/types/scheduled_form_send_response_submission.rb +10 -0
  82. data/lib/pinnacle/types/scheduled_form_send_result.rb +13 -0
  83. data/lib/pinnacle/types/select_field.rb +11 -0
  84. data/lib/pinnacle/types/send_form_options.rb +11 -0
  85. data/lib/pinnacle/types/send_form_options_webview_mode.rb +13 -0
  86. data/lib/pinnacle/types/send_form_params.rb +20 -0
  87. data/lib/pinnacle/types/send_form_result.rb +17 -0
  88. data/lib/pinnacle/types/send_form_via_rcs_params.rb +14 -0
  89. data/lib/pinnacle/types/send_form_via_rcs_request_fallback.rb +10 -0
  90. data/lib/pinnacle/types/send_form_via_rcs_request_form.rb +13 -0
  91. data/lib/pinnacle/types/send_form_via_sms_params.rb +13 -0
  92. data/lib/pinnacle/types/send_form_via_sms_request_form.rb +12 -0
  93. data/lib/pinnacle/types/send_rich_cards_options.rb +5 -0
  94. data/lib/pinnacle/types/send_rich_message_options_4.rb +13 -0
  95. data/lib/pinnacle/types/text_field.rb +13 -0
  96. data/lib/pinnacle/types/textarea_field.rb +13 -0
  97. data/lib/pinnacle/types/time_field.rb +12 -0
  98. data/lib/pinnacle/types/url_field.rb +10 -0
  99. data/lib/pinnacle/types/vcard_content.rb +1 -1
  100. data/lib/pinnacle/types/webhook_event_enum.rb +1 -0
  101. data/lib/pinnacle/types/webhook_summary.rb +1 -0
  102. data/lib/pinnacle/types/webhooks.rb +1 -0
  103. data/lib/pinnacle/version.rb +1 -1
  104. data/lib/pinnacle/webhooks/client.rb +7 -1
  105. data/lib/pinnacle/webhooks/types/attach_webhook_params.rb +1 -0
  106. data/lib/pinnacle/wrapper/messages/client.rb +5 -2
  107. data/lib/pinnacle.rb +67 -1
  108. data/reference.md +826 -301
  109. metadata +68 -2
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Sparse override layered on top of your team's theme. Every field is optional; provided fields replace the
6
+ # corresponding team defaults at render time. URL fields must use `https://`.
7
+ class FormThemeOverride < Internal::Types::Model
8
+ field :logo_url, -> { String }, optional: true, nullable: false
9
+ field :favicon_url, -> { String }, optional: true, nullable: false
10
+ field :theme_mode, -> { Pinnacle::Types::FormThemeOverrideThemeMode }, optional: true, nullable: false
11
+ field :colors, -> { Pinnacle::Types::FormThemeOverrideColors }, optional: true, nullable: false
12
+ field :font_family, -> { Pinnacle::Types::FormThemeOverrideFontFamily }, optional: true, nullable: false
13
+ field :corner_radius, -> { Pinnacle::Types::FormThemeOverrideCornerRadius }, optional: true, nullable: false
14
+ field :content_alignment, -> { Pinnacle::Types::FormThemeOverrideContentAlignment }, optional: true, nullable: false
15
+ field :background, -> { Pinnacle::Types::FormBackground }, optional: true, nullable: false
16
+ field :submit_button_label, -> { String }, optional: true, nullable: false
17
+ field :success_message, -> { String }, optional: true, nullable: false
18
+ field :redirect_url, -> { String }, optional: true, nullable: false
19
+ field :privacy_url, -> { String }, optional: true, nullable: false
20
+ field :terms_url, -> { String }, optional: true, nullable: false
21
+ field :og_image_url, -> { String }, optional: true, nullable: false
22
+ field :og_description, -> { String }, optional: true, nullable: false
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Per-mode palette overrides. Each mode is an object with optional `primary`, `background`, and `text` hex colors.
6
+ # Omit a mode to inherit the team default for it.
7
+ class FormThemeOverrideColors < Internal::Types::Model
8
+ field :light, -> { Pinnacle::Types::FormColorPalette }, optional: true, nullable: false
9
+ field :dark, -> { Pinnacle::Types::FormColorPalette }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ module FormThemeOverrideContentAlignment
6
+ extend Pinnacle::Internal::Types::Enum
7
+
8
+ LEFT = "left"
9
+ CENTER = "center"
10
+ RIGHT = "right"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ module FormThemeOverrideCornerRadius
6
+ extend Pinnacle::Internal::Types::Enum
7
+
8
+ SHARP = "sharp"
9
+ ROUNDED = "rounded"
10
+ PILL = "pill"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ module FormThemeOverrideFontFamily
6
+ extend Pinnacle::Internal::Types::Enum
7
+
8
+ INTER = "inter"
9
+ SYSTEM = "system"
10
+ SERIF = "serif"
11
+ MONO = "mono"
12
+ ROUNDED = "rounded"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ module FormThemeOverrideThemeMode
6
+ extend Pinnacle::Internal::Types::Enum
7
+
8
+ LIGHT = "light"
9
+ DARK = "dark"
10
+ AUTO = "auto"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Paginated page of submissions for a form.
6
+ class ListFormSubmissionsResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Pinnacle::Types::FormSubmission] }, optional: false, nullable: false
8
+ field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasMore"
9
+ field :count, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Paginated page of forms.
6
+ class ListFormsResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Pinnacle::Types::Form] }, optional: false, nullable: false
8
+ field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasMore"
9
+ field :count, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Numeric input with optional `min` / `max` bounds and `step` granularity.
6
+ class NumberField < Internal::Types::Model
7
+ field :placeholder, -> { String }, optional: true, nullable: false
8
+ field :min, -> { Integer }, optional: true, nullable: false
9
+ field :max, -> { Integer }, optional: true, nullable: false
10
+ field :step, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Phone input. Client formats the value as the user types ("(555) 555-1212") and normalizes to E.164
6
+ # ("+15555551212") before submission.
7
+ class PhoneField < Internal::Types::Model
8
+ field :placeholder, -> { String }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Single-select radio group.
6
+ class RadioField < Internal::Types::Model
7
+ field :options, -> { Internal::Types::Array[Pinnacle::Types::FormFieldOption] }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Slider input. `min`/`max` define the bounds, `step` the granularity.
6
+ class RangeField < Internal::Types::Model
7
+ field :min, -> { Integer }, optional: true, nullable: false
8
+ field :max, -> { Integer }, optional: true, nullable: false
9
+ field :step, -> { Integer }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Star rating 1..`max`. Submitted value is the selected integer.
6
+ class RatingField < Internal::Types::Model
7
+ field :min, -> { Integer }, optional: true, nullable: false
8
+ field :max, -> { Integer }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  # See (supported file types)[https://app.pinnacle.sh/supported-file-types?type=RCS-CARD].
8
8
  class RcsCardsContent < Internal::Types::Model
9
9
  field :cards, -> { Internal::Types::Array[Pinnacle::Types::RcsCardsContentCardsItem] }, optional: false, nullable: false
10
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
10
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
11
11
  end
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ module Pinnacle
4
4
  module Types
5
5
  # Individual card containing title, optional media, and action buttons.
6
6
  class RcsCardsContentCardsItem < Internal::Types::Model
7
- field :buttons, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false
7
+ field :buttons, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false
8
8
  field :media, -> { Pinnacle::Types::RcsMediaDetailsContent }, optional: true, nullable: false
9
9
  field :subtitle, -> { String }, optional: true, nullable: false
10
10
  field :title, -> { String }, optional: false, nullable: false
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  # See (supported file types)[https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA].
8
8
  class RcsMediaContent < Internal::Types::Model
9
9
  field :media, -> { Pinnacle::Types::RcsMediaDetailsContent }, optional: false, nullable: false
10
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
10
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
11
11
  end
12
12
  end
13
13
  end
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  # See [supported media types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
8
8
  class RcsValidateContentMedia < Internal::Types::Model
9
9
  field :media, -> { String }, optional: false, nullable: false
10
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
10
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
11
11
  end
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ module Pinnacle
4
4
  module Types
5
5
  # Individual card containing title, optional media, and action buttons.
6
6
  class RichCard < Internal::Types::Model
7
- field :buttons, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false
7
+ field :buttons, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false
8
8
  field :media, -> { String }, optional: true, nullable: false
9
9
  field :subtitle, -> { String }, optional: true, nullable: false
10
10
  field :title, -> { String }, optional: false, nullable: false
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  # See (supported file types)[https://app.pinnacle.sh/supported-file-types?type=RCS-CARD].
8
8
  class RichCards < Internal::Types::Model
9
9
  field :cards, -> { Internal::Types::Array[Pinnacle::Types::RichCard] }, optional: false, nullable: false
10
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
10
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
11
11
  end
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ module Pinnacle
4
4
  module Types
5
5
  class RichMediaMessage < Internal::Types::Model
6
6
  field :media, -> { String }, optional: false, nullable: false
7
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
7
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module Pinnacle
4
4
  module Types
5
5
  # Message containing longer text content with optional quick reply buttons.
6
6
  class RichText < Internal::Types::Model
7
- field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: false, nullable: false, api_name: "quickReplies"
7
+ field :quick_replies, -> { Internal::Types::Array[Pinnacle::Types::RichButton] }, optional: true, nullable: false, api_name: "quickReplies"
8
8
  field :text, -> { String }, optional: false, nullable: false
9
9
  end
10
10
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ class ScheduledFormSendResponseForm < Internal::Types::Model
6
+ field :id, -> { String }, optional: false, nullable: false
7
+ field :name, -> { String }, optional: false, nullable: true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ class ScheduledFormSendResponseSubmission < Internal::Types::Model
6
+ field :id, -> { String }, optional: false, nullable: false
7
+ field :url, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Response shape for a scheduled form send — returned in place of `SendFormResponse` when `options.schedule` is set.
6
+ class ScheduledFormSendResult < Internal::Types::Model
7
+ field :schedule_id, -> { String }, optional: false, nullable: false, api_name: "scheduleId"
8
+ field :config, -> { Pinnacle::Types::MessageSchedule }, optional: false, nullable: false
9
+ field :form, -> { Pinnacle::Types::ScheduledFormSendResponseForm }, optional: false, nullable: false
10
+ field :submission, -> { Pinnacle::Types::ScheduledFormSendResponseSubmission }, optional: false, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Single-select dropdown.
6
+ class SelectField < Internal::Types::Model
7
+ field :options, -> { Internal::Types::Array[Pinnacle::Types::FormFieldOption] }, optional: false, nullable: false
8
+ field :placeholder, -> { String }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Optional delivery knobs shared by RCS and SMS sends.
6
+ class SendFormOptions < Internal::Types::Model
7
+ field :schedule, -> { Pinnacle::Types::MessageSchedule }, optional: true, nullable: false
8
+ field :webview_mode, -> { Pinnacle::Types::SendFormOptionsWebviewMode }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ module SendFormOptionsWebviewMode
6
+ extend Pinnacle::Internal::Types::Enum
7
+
8
+ FULL = "FULL"
9
+ HALF = "HALF"
10
+ TALL = "TALL"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Send a form to a recipient over SMS or RCS in one call, or mint a standalone submission URL when `to` is omitted.
6
+ # Picks the SMS or RCS branch based on the shape of `from` (agent_* → RCS, E.164 → SMS).
7
+ #
8
+ # When `to` is provided, Pinnacle dispatches the message immediately and the recipient is recorded on the response
9
+ # (`submission.to` is set to the same E.164 number, and `message_id` is the id of the outbound SMS/RCS).
10
+ #
11
+ # When `to` is omitted, no message is sent — `submission.to` and `message_id` are both `null` and only the
12
+ # submission URL is returned.
13
+ class SendFormParams < Internal::Types::Model
14
+ extend Pinnacle::Internal::Types::Union
15
+
16
+ member -> { Pinnacle::Types::SendFormViaRcsParams }
17
+ member -> { Pinnacle::Types::SendFormViaSmsParams }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Successful `POST /forms/send` response.
6
+ #
7
+ # - When `to` was provided in the request, the message was dispatched: `submission.to` echoes that recipient and
8
+ # `message_id` is the id of the outbound SMS/RCS that carried the URL.
9
+ # - When `to` was omitted, no message was sent: both `submission.to` and `message_id` are `null` and only the
10
+ # submission URL is returned.
11
+ class SendFormResult < Internal::Types::Model
12
+ field :form, -> { Pinnacle::Types::Form }, optional: false, nullable: false
13
+ field :submission, -> { Pinnacle::Types::FormSubmission }, optional: false, nullable: false
14
+ field :message_id, -> { String }, optional: false, nullable: true
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Send a form from an RCS agent. `from` must be an `agent_*` id.
6
+ class SendFormViaRcsParams < Internal::Types::Model
7
+ field :from, -> { String }, optional: false, nullable: false
8
+ field :to, -> { String }, optional: true, nullable: false
9
+ field :form, -> { Pinnacle::Types::SendFormViaRcsRequestForm }, optional: false, nullable: false
10
+ field :fallback, -> { Pinnacle::Types::SendFormViaRcsRequestFallback }, optional: true, nullable: false
11
+ field :options, -> { Pinnacle::Types::SendFormOptions }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # When RCS is unavailable on the recipient's device, fall back to SMS from this number. Requires `to`.
6
+ class SendFormViaRcsRequestFallback < Internal::Types::Model
7
+ field :from, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Existing form id or an inline definition that mints a new form for this send.
6
+ class SendFormViaRcsRequestForm < Internal::Types::Model
7
+ extend Pinnacle::Internal::Types::Union
8
+
9
+ member -> { String }
10
+ member -> { Pinnacle::Types::FormDefinition }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Send a form from a phone number. `from` must be an E.164 phone.
6
+ class SendFormViaSmsParams < Internal::Types::Model
7
+ field :from, -> { String }, optional: false, nullable: false
8
+ field :to, -> { String }, optional: true, nullable: false
9
+ field :form, -> { Pinnacle::Types::SendFormViaSmsRequestForm }, optional: false, nullable: false
10
+ field :options, -> { Pinnacle::Types::SendFormOptions }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ class SendFormViaSmsRequestForm < Internal::Types::Model
6
+ extend Pinnacle::Internal::Types::Union
7
+
8
+ member -> { String }
9
+ member -> { Pinnacle::Types::FormDefinition }
10
+ end
11
+ end
12
+ end
@@ -2,7 +2,12 @@
2
2
 
3
3
  module Pinnacle
4
4
  module Types
5
+ # Configure how your RCS message is sent and tracked.
5
6
  class SendRichCardsOptions < Internal::Types::Model
7
+ field :schedule, -> { Pinnacle::Types::MessageSchedule }, optional: true, nullable: false
8
+ field :tracking, -> { Pinnacle::Types::Tracking }, optional: true, nullable: false
9
+ field :transcode, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+ field :validate, -> { Internal::Types::Boolean }, optional: true, nullable: false
6
11
  field :standalone_card, -> { Pinnacle::Types::RichStandaloneCardOptions }, optional: true, nullable: false
7
12
  end
8
13
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Configure how your RCS message is sent and tracked.
6
+ class SendRichMessageOptions4 < Internal::Types::Model
7
+ field :schedule, -> { Pinnacle::Types::MessageSchedule }, optional: true, nullable: false
8
+ field :tracking, -> { Pinnacle::Types::Tracking }, optional: true, nullable: false
9
+ field :transcode, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+ field :validate, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Single-line text input with optional length bounds and regex pattern.
6
+ class TextField < Internal::Types::Model
7
+ field :placeholder, -> { String }, optional: true, nullable: false
8
+ field :pattern, -> { String }, optional: true, nullable: false
9
+ field :min_length, -> { Integer }, optional: true, nullable: false
10
+ field :max_length, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Multi-line text input for longer free-form answers.
6
+ class TextareaField < Internal::Types::Model
7
+ field :placeholder, -> { String }, optional: true, nullable: false
8
+ field :pattern, -> { String }, optional: true, nullable: false
9
+ field :min_length, -> { Integer }, optional: true, nullable: false
10
+ field :max_length, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Time picker. `min`/`max` accept `HH:MM` (24-hour).
6
+ class TimeField < Internal::Types::Model
7
+ field :placeholder, -> { String }, optional: true, nullable: false
8
+ field :min, -> { String }, optional: true, nullable: false
9
+ field :max, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # URL input. Server requires a valid absolute URL.
6
+ class UrlField < Internal::Types::Model
7
+ field :placeholder, -> { String }, optional: true, nullable: false
8
+ end
9
+ end
10
+ end
@@ -3,7 +3,7 @@
3
3
  module Pinnacle
4
4
  module Types
5
5
  class VcardContent < Internal::Types::Model
6
- field :revision, -> { String }, optional: true, nullable: false
6
+ field :revision, -> { String }, optional: false, nullable: false
7
7
  end
8
8
  end
9
9
  end
@@ -8,6 +8,7 @@ module Pinnacle
8
8
  MESSAGE_STATUS = "MESSAGE.STATUS"
9
9
  MESSAGE_RECEIVED = "MESSAGE.RECEIVED"
10
10
  USER_TYPING = "USER.TYPING"
11
+ FORM_SUBMISSION = "FORM.SUBMISSION"
11
12
  end
12
13
  end
13
14
  end
@@ -9,6 +9,7 @@ module Pinnacle
9
9
  field :status, -> { Pinnacle::Types::WebhookSummaryStatus }, optional: false, nullable: false
10
10
  field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
11
11
  field :updated_at, -> { String }, optional: false, nullable: false, api_name: "updatedAt"
12
+ field :headers, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
12
13
  end
13
14
  end
14
15
  end
@@ -7,6 +7,7 @@ module Pinnacle
7
7
  field :endpoint, -> { String }, optional: false, nullable: false
8
8
  field :id, -> { String }, optional: false, nullable: false
9
9
  field :name, -> { String }, optional: false, nullable: false
10
+ field :headers, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
10
11
  end
11
12
  end
12
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pinnacle
4
- VERSION = "2.0.15"
4
+ VERSION = "2.0.16.pre.rc.2"
5
5
  end
@@ -85,7 +85,13 @@ module Pinnacle
85
85
  # Supports bulk operations with up to 50 senders per request. <br>
86
86
  #
87
87
  # Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender
88
- # updates the event type filter without creating duplicates.
88
+ # updates the event type filter without creating duplicates. <br>
89
+ #
90
+ # **Custom headers** may be provided in either case via the optional `headers` field. When attaching a new
91
+ # webhook, the headers are stored on the webhook and sent on every delivery. When attaching an existing
92
+ # `webhookId`, supplying `headers` **overwrites** the stored headers on that webhook — omit the field to leave
93
+ # them unchanged, or pass an empty object `{}` to clear them. The reserved `PINNACLE-SIGNING-SECRET` header is
94
+ # always set by Pinnacle and cannot be overridden.
89
95
  #
90
96
  # @param request_options [Hash]
91
97
  # @param params [Pinnacle::Webhooks::Types::AttachWebhookParams]
@@ -9,6 +9,7 @@ module Pinnacle
9
9
  field :name, -> { String }, optional: true, nullable: false
10
10
  field :url, -> { String }, optional: true, nullable: false
11
11
  field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: true, nullable: false
12
+ field :headers, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
12
13
  end
13
14
  end
14
15
  end
@@ -19,7 +19,7 @@ module Pinnacle
19
19
  # @param request [Hash] Request with :headers and :body keys
20
20
  # @param secret [String, nil] Webhook secret (falls back to PINNACLE_SIGNING_SECRET env var)
21
21
  #
22
- # @return [Pinnacle::Types::MessageEvent, Pinnacle::Types::UserEvent]
22
+ # @return [Pinnacle::Types::MessageEvent, Pinnacle::Types::UserEvent, Pinnacle::Types::FormSubmissionEvent]
23
23
  # @raise [Pinnacle::Errors::UnauthorizedError] If webhook signature is invalid or missing
24
24
  # @raise [Pinnacle::Errors::ClientError] If request body cannot be parsed
25
25
  def process(request, secret: nil)
@@ -55,8 +55,11 @@ module Pinnacle
55
55
 
56
56
  parsed = body.is_a?(String) ? JSON.parse(body) : body
57
57
 
58
- if parsed["type"] == "USER.TYPING"
58
+ case parsed["type"]
59
+ when "USER.TYPING"
59
60
  Pinnacle::Types::UserEvent.coerce(parsed)
61
+ when "FORM.SUBMISSION"
62
+ Pinnacle::Types::FormSubmissionEvent.coerce(parsed)
60
63
  else
61
64
  Pinnacle::Types::MessageEvent.coerce(parsed)
62
65
  end