rcs 2.0.14 → 2.0.15

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/lib/pinnacle/campaigns/rcs/types/upsert_rcs_campaign_params.rb +3 -6
  4. data/lib/pinnacle/client.rb +1 -1
  5. data/lib/pinnacle/phone_numbers/client.rb +0 -5
  6. data/lib/pinnacle/types/attach_webhook_response_webhook.rb +1 -2
  7. data/lib/pinnacle/types/attach_webhook_result.rb +12 -0
  8. data/lib/pinnacle/types/detach_webhook_result.rb +11 -0
  9. data/lib/pinnacle/types/extended_rcs_campaign.rb +3 -6
  10. data/lib/pinnacle/types/failed_sender.rb +10 -0
  11. data/lib/pinnacle/types/rcs_campaign.rb +3 -6
  12. data/lib/pinnacle/types/rcs_campaign_summary.rb +0 -1
  13. data/lib/pinnacle/types/webhook_event_enum.rb +1 -0
  14. data/lib/pinnacle/version.rb +1 -1
  15. data/lib/pinnacle/webhooks/client.rb +79 -0
  16. data/lib/pinnacle/webhooks/types/attach_webhook_params.rb +15 -0
  17. data/lib/pinnacle/webhooks/types/detach_webhook_params.rb +12 -0
  18. data/lib/pinnacle.rb +7 -12
  19. data/reference.md +189 -204
  20. metadata +7 -12
  21. data/lib/pinnacle/campaigns/rcs/types/rcs_use_case.rb +0 -15
  22. data/lib/pinnacle/phone_numbers/webhook/client.rb +0 -90
  23. data/lib/pinnacle/types/attach_webhook_by_id_params.rb +0 -11
  24. data/lib/pinnacle/types/attach_webhook_params.rb +0 -15
  25. data/lib/pinnacle/types/configured_webhook.rb +0 -13
  26. data/lib/pinnacle/types/create_and_attach_webhook_by_url_params.rb +0 -12
  27. data/lib/pinnacle/types/detached_webhook_info.rb +0 -11
  28. data/lib/pinnacle/types/rcs_campaign_schema_extra_use_case.rb +0 -11
  29. data/lib/pinnacle/types/rcs_campaign_schema_use_case.rb +0 -11
  30. data/lib/pinnacle/types/rcs_campaign_use_case_enum.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 362ad9ba7c8c47a7e24f2e98ae2b6a4af84b43e66faaa0682622414565a8f5de
4
- data.tar.gz: eb18c0b9268ce71ae35a20a2b6a8a68409f80637fa495faac8a93a541f59bd3b
3
+ metadata.gz: 3edce2029ee0605b95569ddf5681f98c17041bb376e2d480487cac489f7a3373
4
+ data.tar.gz: c8ab3851d9d26d7502df2c3183c35525d7aed0b18831fbbf100b158f001cb3a8
5
5
  SHA512:
6
- metadata.gz: af1d17f92bbd2f7e9835f1b9360dc4bb93d5b88140951da73ef943bcc83b38cc2189d7e914dee005bf61101cf17feb643814bd7695acd41d20ce996e1af47a9b
7
- data.tar.gz: c89f1854e0650dfcb4a01a46c88f4016007550e8c3d642f4578e1835cc3b744c0cc61cb6e662625e6e2e9a562c3d41a95d0934c26dacce2ac535e6fd583d2749
6
+ metadata.gz: 2bde1ac9823654bb075fafb0fee86d1b7874fc6f9b161021efbf11ae1cdbc465e1db7791c0e87fd15d9c01693f2994946156485f9ba40e318a1968174852ed6c
7
+ data.tar.gz: eca831fdf06ad136fa518a08bd5fe00782d2e86c512a433af37dd7a741148d1bc3762c22a873cf9061a68eeb7c3044e7ca865fa717985f615e4b5739a65a46c7
data/.fern/metadata.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "cliVersion": "3.51.3",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
- "generatorVersion": "1.0.0-rc84",
4
+ "generatorVersion": "1.0.0-rc85",
5
5
  "generatorConfig": {
6
6
  "clientModuleName": "PinnacleBaseClient",
7
7
  "flattenModuleStructure": true,
8
8
  "useProvidedDefaults": true
9
9
  },
10
- "sdkVersion": "2.0.14"
10
+ "sdkVersion": "2.0.15"
11
11
  }
@@ -10,15 +10,12 @@ module Pinnacle
10
10
  field :campaign_id, -> { String }, optional: true, nullable: false, api_name: "campaignId"
11
11
  field :expected_agent_responses, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "expectedAgentResponses"
12
12
  field :links, -> { Pinnacle::Campaigns::Rcs::Types::RcsLinks }, optional: true, nullable: false
13
- field :use_case, -> { Pinnacle::Campaigns::Rcs::Types::RcsUseCase }, optional: true, nullable: false, api_name: "useCase"
14
- field :opt_in_terms_and_conditions, -> { String }, optional: true, nullable: false, api_name: "optInTermsAndConditions"
13
+ field :use_case_description, -> { String }, optional: true, nullable: false, api_name: "useCaseDescription"
15
14
  field :messaging_type, -> { Pinnacle::Types::RcsMessagingTypeEnum }, optional: true, nullable: false, api_name: "messagingType"
16
- field :carrier_description, -> { String }, optional: true, nullable: false, api_name: "carrierDescription"
15
+ field :cta_media, -> { String }, optional: true, nullable: false, api_name: "ctaMedia"
16
+ field :opt_in_method, -> { String }, optional: true, nullable: false, api_name: "optInMethod"
17
17
  field :keywords, -> { Pinnacle::Campaigns::Rcs::Types::RcsCampaignKeywords }, optional: true, nullable: false
18
18
  field :traffic, -> { Pinnacle::Campaigns::Rcs::Types::RcsCampaignTraffic }, optional: true, nullable: false
19
- field :agent_triggers, -> { String }, optional: true, nullable: false, api_name: "agentTriggers"
20
- field :interaction_description, -> { String }, optional: true, nullable: false, api_name: "interactionDescription"
21
- field :is_conversational, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isConversational"
22
19
  field :cta_language, -> { String }, optional: true, nullable: false, api_name: "ctaLanguage"
23
20
  field :demo_trigger, -> { String }, optional: true, nullable: false, api_name: "demoTrigger"
24
21
  end
@@ -10,7 +10,7 @@ module Pinnacle
10
10
  @raw_client = Pinnacle::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Pinnacle::Environment::DEFAULT,
12
12
  headers: {
13
- "User-Agent" => "rcs/2.0.14",
13
+ "User-Agent" => "rcs/2.0.15",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "PINNACLE-API-KEY" => api_key.to_s
16
16
  }
@@ -144,11 +144,6 @@ module Pinnacle
144
144
  end
145
145
  end
146
146
 
147
- # @return [Pinnacle::Webhook::Client]
148
- def webhook
149
- @webhook ||= Pinnacle::PhoneNumbers::Webhook::Client.new(client: @client)
150
- end
151
-
152
147
  # @return [Pinnacle::Campaign::Client]
153
148
  def campaign
154
149
  @campaign ||= Pinnacle::PhoneNumbers::Campaign::Client.new(client: @client)
@@ -2,12 +2,11 @@
2
2
 
3
3
  module Pinnacle
4
4
  module Types
5
- # Detailed information about the attached webhook.
6
5
  class AttachWebhookResponseWebhook < Internal::Types::Model
7
6
  field :id, -> { String }, optional: false, nullable: false
8
7
  field :name, -> { String }, optional: false, nullable: false
9
8
  field :url, -> { String }, optional: false, nullable: false
10
- field :secret, -> { String }, optional: true, nullable: false
9
+ field :secret, -> { String }, optional: false, nullable: false
11
10
  end
12
11
  end
13
12
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ class AttachWebhookResult < Internal::Types::Model
6
+ field :webhook, -> { Pinnacle::Types::AttachWebhookResponseWebhook }, optional: false, nullable: false
7
+ field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: false, nullable: true
8
+ field :senders, -> { Internal::Types::Array[String] }, optional: false, nullable: false
9
+ field :failed, -> { Internal::Types::Array[Pinnacle::Types::FailedSender] }, optional: false, 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
+ class DetachWebhookResult < Internal::Types::Model
6
+ field :webhook_id, -> { String }, optional: false, nullable: false, api_name: "webhookId"
7
+ field :senders, -> { Internal::Types::Array[String] }, optional: false, nullable: false
8
+ field :failed, -> { Internal::Types::Array[Pinnacle::Types::FailedSender] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
@@ -10,15 +10,12 @@ module Pinnacle
10
10
  field :expected_agent_responses, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "expectedAgentResponses"
11
11
  field :links, -> { Pinnacle::Types::RcsCampaignSchemaExtraLinks }, optional: true, nullable: false
12
12
  field :status, -> { Pinnacle::Types::ProfileStatusEnum }, optional: false, nullable: false
13
- field :use_case, -> { Pinnacle::Types::RcsCampaignSchemaExtraUseCase }, optional: true, nullable: false, api_name: "useCase"
14
- field :opt_in_terms_and_conditions, -> { String }, optional: true, nullable: false, api_name: "optInTermsAndConditions"
13
+ field :use_case_description, -> { String }, optional: true, nullable: false, api_name: "useCaseDescription"
15
14
  field :messaging_type, -> { Pinnacle::Types::RcsMessagingTypeEnum }, optional: true, nullable: false, api_name: "messagingType"
16
- field :carrier_description, -> { String }, optional: true, nullable: false, api_name: "carrierDescription"
15
+ field :cta_media, -> { String }, optional: true, nullable: false, api_name: "ctaMedia"
16
+ field :opt_in_method, -> { String }, optional: true, nullable: false, api_name: "optInMethod"
17
17
  field :keywords, -> { Pinnacle::Types::RcsCampaignSchemaExtraKeywords }, optional: true, nullable: false
18
18
  field :traffic, -> { Pinnacle::Types::RcsCampaignSchemaExtraTraffic }, optional: true, nullable: false
19
- field :agent_triggers, -> { String }, optional: true, nullable: false, api_name: "agentTriggers"
20
- field :interaction_description, -> { String }, optional: true, nullable: false, api_name: "interactionDescription"
21
- field :is_conversational, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isConversational"
22
19
  field :cta_language, -> { String }, optional: true, nullable: false, api_name: "ctaLanguage"
23
20
  field :demo_trigger, -> { String }, optional: true, nullable: false, api_name: "demoTrigger"
24
21
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ class FailedSender < Internal::Types::Model
6
+ field :sender, -> { String }, optional: false, nullable: false
7
+ field :error, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -7,15 +7,12 @@ module Pinnacle
7
7
  field :campaign_id, -> { String }, optional: true, nullable: false, api_name: "campaignId"
8
8
  field :expected_agent_responses, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "expectedAgentResponses"
9
9
  field :links, -> { Pinnacle::Types::RcsCampaignSchemaLinks }, optional: true, nullable: false
10
- field :use_case, -> { Pinnacle::Types::RcsCampaignSchemaUseCase }, optional: true, nullable: false, api_name: "useCase"
11
- field :opt_in_terms_and_conditions, -> { String }, optional: true, nullable: false, api_name: "optInTermsAndConditions"
10
+ field :use_case_description, -> { String }, optional: true, nullable: false, api_name: "useCaseDescription"
12
11
  field :messaging_type, -> { Pinnacle::Types::RcsMessagingTypeEnum }, optional: true, nullable: false, api_name: "messagingType"
13
- field :carrier_description, -> { String }, optional: true, nullable: false, api_name: "carrierDescription"
12
+ field :cta_media, -> { String }, optional: true, nullable: false, api_name: "ctaMedia"
13
+ field :opt_in_method, -> { String }, optional: true, nullable: false, api_name: "optInMethod"
14
14
  field :keywords, -> { Pinnacle::Types::RcsCampaignSchemaKeywords }, optional: true, nullable: false
15
15
  field :traffic, -> { Pinnacle::Types::RcsCampaignSchemaTraffic }, optional: true, nullable: false
16
- field :agent_triggers, -> { String }, optional: true, nullable: false, api_name: "agentTriggers"
17
- field :interaction_description, -> { String }, optional: true, nullable: false, api_name: "interactionDescription"
18
- field :is_conversational, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isConversational"
19
16
  field :cta_language, -> { String }, optional: true, nullable: false, api_name: "ctaLanguage"
20
17
  field :demo_trigger, -> { String }, optional: true, nullable: false, api_name: "demoTrigger"
21
18
  end
@@ -7,7 +7,6 @@ module Pinnacle
7
7
  field :name, -> { String }, optional: true, nullable: false
8
8
  field :status, -> { Pinnacle::Types::RcsCampaignSummaryStatus }, optional: false, nullable: false
9
9
  field :brand_id, -> { String }, optional: true, nullable: false, api_name: "brandId"
10
- field :use_case, -> { String }, optional: true, nullable: false, api_name: "useCase"
11
10
  field :agent_id, -> { String }, optional: true, nullable: false, api_name: "agentId"
12
11
  field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
13
12
  field :updated_at, -> { String }, optional: false, nullable: false, api_name: "updatedAt"
@@ -7,6 +7,7 @@ module Pinnacle
7
7
 
8
8
  MESSAGE_STATUS = "MESSAGE.STATUS"
9
9
  MESSAGE_RECEIVED = "MESSAGE.RECEIVED"
10
+ USER_TYPING = "USER.TYPING"
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.14"
4
+ VERSION = "2.0.15"
5
5
  end
@@ -77,6 +77,85 @@ module Pinnacle
77
77
  raise error_class.new(response.body, code: code)
78
78
  end
79
79
  end
80
+
81
+ # Attach a webhook to one or more senders (phone numbers or RCS agent IDs) to receive real-time event
82
+ # notifications. <br>
83
+ #
84
+ # You can attach an existing webhook by providing its ID, or create a new webhook by specifying a name and URL.
85
+ # Supports bulk operations with up to 50 senders per request. <br>
86
+ #
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.
89
+ #
90
+ # @param request_options [Hash]
91
+ # @param params [Pinnacle::Webhooks::Types::AttachWebhookParams]
92
+ # @option request_options [String] :base_url
93
+ # @option request_options [Hash{String => Object}] :additional_headers
94
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
95
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
96
+ # @option request_options [Integer] :timeout_in_seconds
97
+ #
98
+ # @return [Pinnacle::Types::AttachWebhookResult]
99
+ def attach(request_options: {}, **params)
100
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
101
+ request = Pinnacle::Internal::JSON::Request.new(
102
+ base_url: request_options[:base_url],
103
+ method: "POST",
104
+ path: "webhooks/attach",
105
+ body: Pinnacle::Webhooks::Types::AttachWebhookParams.new(params).to_h,
106
+ request_options: request_options
107
+ )
108
+ begin
109
+ response = @client.send(request)
110
+ rescue Net::HTTPRequestTimeout
111
+ raise Pinnacle::Errors::TimeoutError
112
+ end
113
+ code = response.code.to_i
114
+ if code.between?(200, 299)
115
+ Pinnacle::Types::AttachWebhookResult.load(response.body)
116
+ else
117
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
118
+ raise error_class.new(response.body, code: code)
119
+ end
120
+ end
121
+
122
+ # Detach a webhook from one or more senders (phone numbers or RCS agent IDs) to stop receiving event
123
+ # notifications. <br>
124
+ #
125
+ # The webhook itself is not deleted and remains available for use with other senders. Works regardless of webhook
126
+ # status. Supports bulk operations with up to 50 senders per request.
127
+ #
128
+ # @param request_options [Hash]
129
+ # @param params [Pinnacle::Webhooks::Types::DetachWebhookParams]
130
+ # @option request_options [String] :base_url
131
+ # @option request_options [Hash{String => Object}] :additional_headers
132
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
133
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
134
+ # @option request_options [Integer] :timeout_in_seconds
135
+ #
136
+ # @return [Pinnacle::Types::DetachWebhookResult]
137
+ def detach(request_options: {}, **params)
138
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
139
+ request = Pinnacle::Internal::JSON::Request.new(
140
+ base_url: request_options[:base_url],
141
+ method: "POST",
142
+ path: "webhooks/detach",
143
+ body: Pinnacle::Webhooks::Types::DetachWebhookParams.new(params).to_h,
144
+ request_options: request_options
145
+ )
146
+ begin
147
+ response = @client.send(request)
148
+ rescue Net::HTTPRequestTimeout
149
+ raise Pinnacle::Errors::TimeoutError
150
+ end
151
+ code = response.code.to_i
152
+ if code.between?(200, 299)
153
+ Pinnacle::Types::DetachWebhookResult.load(response.body)
154
+ else
155
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
156
+ raise error_class.new(response.body, code: code)
157
+ end
158
+ end
80
159
  end
81
160
  end
82
161
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Webhooks
5
+ module Types
6
+ class AttachWebhookParams < Internal::Types::Model
7
+ field :senders, -> { Internal::Types::Array[String] }, optional: false, nullable: false
8
+ field :webhook_id, -> { String }, optional: true, nullable: false, api_name: "webhookId"
9
+ field :name, -> { String }, optional: true, nullable: false
10
+ field :url, -> { String }, optional: true, nullable: false
11
+ field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Webhooks
5
+ module Types
6
+ class DetachWebhookParams < Internal::Types::Model
7
+ field :webhook_id, -> { String }, optional: false, nullable: false, api_name: "webhookId"
8
+ field :senders, -> { Internal::Types::Array[String] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
data/lib/pinnacle.rb CHANGED
@@ -110,14 +110,12 @@ require_relative "pinnacle/campaigns/toll_free/types/toll_free_campaign_opt_in"
110
110
  require_relative "pinnacle/campaigns/toll_free/types/toll_free_campaign_options"
111
111
  require_relative "pinnacle/campaigns/toll_free/types/toll_free_campaign_use_case"
112
112
  require_relative "pinnacle/campaigns/toll_free/types/list_toll_free_campaigns_request_status"
113
- require_relative "pinnacle/types/rcs_campaign_use_case_enum"
114
113
  require_relative "pinnacle/types/rcs_messaging_type_enum"
115
114
  require_relative "pinnacle/types/rcs_campaign_schema_agent_emails_item"
116
115
  require_relative "pinnacle/types/rcs_campaign_schema_agent_phones_item"
117
116
  require_relative "pinnacle/types/rcs_campaign_schema_agent_websites_item"
118
117
  require_relative "pinnacle/types/rcs_campaign_schema_agent"
119
118
  require_relative "pinnacle/types/rcs_campaign_schema_links"
120
- require_relative "pinnacle/types/rcs_campaign_schema_use_case"
121
119
  require_relative "pinnacle/types/rcs_campaign_schema_keywords_help"
122
120
  require_relative "pinnacle/types/rcs_campaign_schema_keywords_opt_in"
123
121
  require_relative "pinnacle/types/rcs_campaign_schema_keywords_opt_out"
@@ -130,7 +128,6 @@ require_relative "pinnacle/campaigns/rcs/types/rcs_agent_phone"
130
128
  require_relative "pinnacle/campaigns/rcs/types/rcs_agent_website"
131
129
  require_relative "pinnacle/campaigns/rcs/types/rcs_agent"
132
130
  require_relative "pinnacle/campaigns/rcs/types/rcs_links"
133
- require_relative "pinnacle/campaigns/rcs/types/rcs_use_case"
134
131
  require_relative "pinnacle/campaigns/rcs/types/rcs_campaign_help_keywords"
135
132
  require_relative "pinnacle/campaigns/rcs/types/rcs_campaign_opt_in_keywords"
136
133
  require_relative "pinnacle/campaigns/rcs/types/rcs_campaign_opt_out_keywords"
@@ -229,7 +226,6 @@ require_relative "pinnacle/types/rcs_campaign_schema_extra_agent_phones_item"
229
226
  require_relative "pinnacle/types/rcs_campaign_schema_extra_agent_websites_item"
230
227
  require_relative "pinnacle/types/rcs_campaign_schema_extra_agent"
231
228
  require_relative "pinnacle/types/rcs_campaign_schema_extra_links"
232
- require_relative "pinnacle/types/rcs_campaign_schema_extra_use_case"
233
229
  require_relative "pinnacle/types/rcs_campaign_schema_extra_keywords_help"
234
230
  require_relative "pinnacle/types/rcs_campaign_schema_extra_keywords_opt_in"
235
231
  require_relative "pinnacle/types/rcs_campaign_schema_extra_keywords_opt_out"
@@ -344,13 +340,6 @@ require_relative "pinnacle/types/phone_number_region"
344
340
  require_relative "pinnacle/types/phone_number_details"
345
341
  require_relative "pinnacle/types/buy_response_capabilities"
346
342
  require_relative "pinnacle/types/purchased_number"
347
- require_relative "pinnacle/types/webhook_event_enum"
348
- require_relative "pinnacle/types/attach_webhook_by_id_params"
349
- require_relative "pinnacle/types/create_and_attach_webhook_by_url_params"
350
- require_relative "pinnacle/types/attach_webhook_params"
351
- require_relative "pinnacle/types/attach_webhook_response_webhook"
352
- require_relative "pinnacle/types/configured_webhook"
353
- require_relative "pinnacle/types/detached_webhook_info"
354
343
  require_relative "pinnacle/types/messaging_profile_enum"
355
344
  require_relative "pinnacle/types/phone_number_campaign_attach_phone_numbers_item_campaign"
356
345
  require_relative "pinnacle/types/phone_number_campaign_attach_phone_numbers_item"
@@ -434,6 +423,11 @@ require_relative "pinnacle/types/webhook_result"
434
423
  require_relative "pinnacle/types/webhook_summary_status"
435
424
  require_relative "pinnacle/types/webhook_summary"
436
425
  require_relative "pinnacle/types/list_webhooks_response"
426
+ require_relative "pinnacle/types/webhook_event_enum"
427
+ require_relative "pinnacle/types/failed_sender"
428
+ require_relative "pinnacle/types/attach_webhook_response_webhook"
429
+ require_relative "pinnacle/types/attach_webhook_result"
430
+ require_relative "pinnacle/types/detach_webhook_result"
437
431
  require_relative "pinnacle/types/message_event_sms_content"
438
432
  require_relative "pinnacle/types/message_event_mms_content"
439
433
  require_relative "pinnacle/types/message_event_rcs_text_content"
@@ -490,6 +484,8 @@ require_relative "pinnacle/rcs/types/rcs_link_request"
490
484
  require_relative "pinnacle/webhooks/client"
491
485
  require_relative "pinnacle/webhooks/types/get_webhook_params"
492
486
  require_relative "pinnacle/webhooks/types/list_webhooks_params"
487
+ require_relative "pinnacle/webhooks/types/attach_webhook_params"
488
+ require_relative "pinnacle/webhooks/types/detach_webhook_params"
493
489
  require_relative "pinnacle/audiences/contacts/client"
494
490
  require_relative "pinnacle/audiences/contacts/types/remove_contacts_params"
495
491
  require_relative "pinnacle/audiences/contacts/types/add_contacts_params"
@@ -518,7 +514,6 @@ require_relative "pinnacle/messages/schedules/client"
518
514
  require_relative "pinnacle/messages/schedules/types/list_scheduled_messages_params"
519
515
  require_relative "pinnacle/messages/blasts/client"
520
516
  require_relative "pinnacle/messages/blasts/types/list_blasts_params"
521
- require_relative "pinnacle/phone_numbers/webhook/client"
522
517
  require_relative "pinnacle/phone_numbers/campaign/client"
523
518
  require_relative "pinnacle/phone_numbers/campaign/types/attach_campaign_params"
524
519
  require_relative "pinnacle/phone_numbers/campaign/types/detach_campaign_params"
data/reference.md CHANGED
@@ -2763,6 +2763,183 @@ client.webhooks.list();
2763
2763
  </dl>
2764
2764
 
2765
2765
 
2766
+ </dd>
2767
+ </dl>
2768
+ </details>
2769
+
2770
+ <details><summary><code>client.webhooks.<a href="/lib/pinnacle/webhooks/client.rb">attach</a>(request) -> Pinnacle::Types::AttachWebhookResult</code></summary>
2771
+ <dl>
2772
+ <dd>
2773
+
2774
+ #### 📝 Description
2775
+
2776
+ <dl>
2777
+ <dd>
2778
+
2779
+ <dl>
2780
+ <dd>
2781
+
2782
+ Attach a webhook to one or more senders (phone numbers or RCS agent IDs) to receive real-time event notifications. <br>
2783
+
2784
+ You can attach an existing webhook by providing its ID, or create a new webhook by specifying a name and URL. Supports bulk operations with up to 50 senders per request. <br>
2785
+
2786
+ Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender updates the event type filter without creating duplicates.
2787
+ </dd>
2788
+ </dl>
2789
+ </dd>
2790
+ </dl>
2791
+
2792
+ #### 🔌 Usage
2793
+
2794
+ <dl>
2795
+ <dd>
2796
+
2797
+ <dl>
2798
+ <dd>
2799
+
2800
+ ```ruby
2801
+ client.webhooks.attach(senders: ['+14155551234', 'agent_abc123']);
2802
+ ```
2803
+ </dd>
2804
+ </dl>
2805
+ </dd>
2806
+ </dl>
2807
+
2808
+ #### ⚙️ Parameters
2809
+
2810
+ <dl>
2811
+ <dd>
2812
+
2813
+ <dl>
2814
+ <dd>
2815
+
2816
+ **senders:** `Internal::Types::Array[String]` — Array of senders to attach the webhook to. Can be phone numbers in E.164 format or RCS agent IDs.
2817
+
2818
+ </dd>
2819
+ </dl>
2820
+
2821
+ <dl>
2822
+ <dd>
2823
+
2824
+ **webhook_id:** `String` — Existing webhook ID (starts with `wh_`). Provide this OR `name` + `url` to create a new webhook. The webhook must be in ENABLED status. Disabled webhooks can be re-enabled from the [dashboard](https://app.pinnacle.sh/dashboard/development/webhooks).
2825
+
2826
+ </dd>
2827
+ </dl>
2828
+
2829
+ <dl>
2830
+ <dd>
2831
+
2832
+ **name:** `String` — Name for a new webhook (required if no `webhookId`).
2833
+
2834
+ </dd>
2835
+ </dl>
2836
+
2837
+ <dl>
2838
+ <dd>
2839
+
2840
+ **url:** `String` — HTTPS endpoint URL for a new webhook (required if no `webhookId`).
2841
+
2842
+ </dd>
2843
+ </dl>
2844
+
2845
+ <dl>
2846
+ <dd>
2847
+
2848
+ **event:** `Pinnacle::Types::WebhookEventEnum`
2849
+
2850
+ Event type filter for the subscription. Set to `null` to receive all events. <br>
2851
+
2852
+ `USER.TYPING` is only supported for RCS agent senders, not phone numbers.
2853
+
2854
+ </dd>
2855
+ </dl>
2856
+
2857
+ <dl>
2858
+ <dd>
2859
+
2860
+ **request_options:** `Pinnacle::Webhooks::RequestOptions`
2861
+
2862
+ </dd>
2863
+ </dl>
2864
+ </dd>
2865
+ </dl>
2866
+
2867
+
2868
+ </dd>
2869
+ </dl>
2870
+ </details>
2871
+
2872
+ <details><summary><code>client.webhooks.<a href="/lib/pinnacle/webhooks/client.rb">detach</a>(request) -> Pinnacle::Types::DetachWebhookResult</code></summary>
2873
+ <dl>
2874
+ <dd>
2875
+
2876
+ #### 📝 Description
2877
+
2878
+ <dl>
2879
+ <dd>
2880
+
2881
+ <dl>
2882
+ <dd>
2883
+
2884
+ Detach a webhook from one or more senders (phone numbers or RCS agent IDs) to stop receiving event notifications. <br>
2885
+
2886
+ The webhook itself is not deleted and remains available for use with other senders. Works regardless of webhook status. Supports bulk operations with up to 50 senders per request.
2887
+ </dd>
2888
+ </dl>
2889
+ </dd>
2890
+ </dl>
2891
+
2892
+ #### 🔌 Usage
2893
+
2894
+ <dl>
2895
+ <dd>
2896
+
2897
+ <dl>
2898
+ <dd>
2899
+
2900
+ ```ruby
2901
+ client.webhooks.detach(
2902
+ webhook_id: 'webhookId',
2903
+ senders: ['+14155551234', 'agent_abc123']
2904
+ );
2905
+ ```
2906
+ </dd>
2907
+ </dl>
2908
+ </dd>
2909
+ </dl>
2910
+
2911
+ #### ⚙️ Parameters
2912
+
2913
+ <dl>
2914
+ <dd>
2915
+
2916
+ <dl>
2917
+ <dd>
2918
+
2919
+ **webhook_id:** `String` — Webhook ID to detach (starts with `wh_`). Must be a webhook owned by your team.
2920
+
2921
+ </dd>
2922
+ </dl>
2923
+
2924
+ <dl>
2925
+ <dd>
2926
+
2927
+ **senders:** `Internal::Types::Array[String]` — Array of senders to detach the webhook from. Can be phone numbers in E.164 format or RCS agent IDs.
2928
+
2929
+ </dd>
2930
+ </dl>
2931
+
2932
+ <dl>
2933
+ <dd>
2934
+
2935
+ **request_options:** `Pinnacle::Webhooks::RequestOptions`
2936
+
2937
+ </dd>
2938
+ </dl>
2939
+ </dd>
2940
+ </dl>
2941
+
2942
+
2766
2943
  </dd>
2767
2944
  </dl>
2768
2945
  </details>
@@ -4245,20 +4422,17 @@ client.campaigns.rcs.upsert(
4245
4422
  campaign_id: 'rcs_1234567890',
4246
4423
  expected_agent_responses: ['Here are the things I can help you with.', 'I can assist you with booking an appointment, or you may choose to book manually.', 'Here are the available times to connect with a representative tomorrow.', 'Your appointment has been scheduled.'],
4247
4424
  links: {
4248
- privacy_policy: 'https://www.trypinnacle.app/privacy',
4249
- terms_of_service: 'https://www.trypinnacle.app/terms'
4250
- },
4251
- use_case: {
4252
- behavior: 'Pinnacle is a developer-focused RCS assistant that helps teams design, test, and optimize rich messaging experiences across SMS, MMS, and RCS. The agent acts as both an “onboarding guide” for new customers and a “best-practices coach” for existing teams exploring higher-value RCS workflows like rich cards, carousels, and suggested actions.<br>
4253
- The agent delivers a mix of operational updates and educational content (2–6 messages/month). Content includes important platform notices (e.g., deliverability or throughput changes), implementation tips with sample RCS templates, and personalized recommendations on how to upgrade existing SMS campaigns into richer, higher-converting RCS conversations.
4254
- ',
4255
- value: 'OTHER'
4425
+ privacy_policy: 'https://www.trypinnacle.app/privacy',
4426
+ terms_of_service: 'https://www.trypinnacle.app/terms'
4256
4427
  },
4257
- opt_in_terms_and_conditions: 'We ensure consent through an explicit opt-in process that follows 10DLC best practices.Users must agree to receive messages from Pinnacle before the agent sends them any messages.<br>
4428
+ use_case_description: 'Pinnacle is a developer-focused RCS assistant that helps teams design, test, and optimize rich messaging experiences across SMS, MMS, and RCS. The agent acts as both an “onboarding guide” for new customers and a “best-practices coach” for existing teams exploring higher-value RCS workflows like rich cards, carousels, and suggested actions.<br>
4429
+ The agent delivers a mix of operational updates and educational content (2–6 messages/month). Content includes important platform notices (e.g., deliverability or throughput changes), implementation tips with sample RCS templates, and personalized recommendations on how to upgrade existing SMS campaigns into richer, higher-converting RCS conversations.
4430
+ ',
4431
+ messaging_type: 'OTP',
4432
+ cta_media: '“https://www.pinnacle.sh/send”',
4433
+ opt_in_method: 'We ensure consent through an explicit opt-in process that follows 10DLC best practices.Users must agree to receive messages from Pinnacle before the agent sends them any messages.<br>
4258
4434
  Users agree to these messages by signing an opt-in paper form that they can be found online at https://www.pinnacle.sh/opt-in. We only send messages once users have filled out the form and submitted it to us via email or through the dashboard.
4259
4435
  ',
4260
- messaging_type: 'MULTI_USE',
4261
- carrier_description: 'Demonstrate the power of RCS to medium and large companies already sending massive SMS/MMS volumes through our platform. These clients send conversational messages in industries such as commerce, appointments, and customer support.',
4262
4436
  keywords: {
4263
4437
  help: {
4264
4438
  message: 'Email founders@trypinnacle.app for support.',
@@ -4281,9 +4455,6 @@ client.campaigns.rcs.upsert(
4281
4455
  monthly_website: 10000,
4282
4456
  monthly_rcs_estimate: 10000
4283
4457
  },
4284
- agent_triggers: 'The agent sends the first message when the user subscribes to Pinnacle. Messages are based on user actions such as pressing suggestion buttons. External triggers such as reminders can be setup by users in advance for a later time.',
4285
- interaction_description: "The agent's primary interaction will be customer service — helping users with questions, troubleshooting issues, and providing quick assistance through chat. Other interactions include appointment management and sending notifications to the user.",
4286
- is_conversational: true,
4287
4458
  cta_language: 'By checking this box and submitting this form, you consent to receive transactional text messages for support, appointment, and reminder messages from Pinnacle Software Development Inc. Reply STOP to opt out. Reply HELP for help. Standard message and data rates may apply. Message frequency may vary. View our Terms and Conditions at https://www.pinnacle.sh/terms. View our Privacy Policy at https://www.pinnacle.sh/privacy.',
4288
4459
  demo_trigger: 'Text "START" to trigger the flow.'
4289
4460
  );
@@ -4344,7 +4515,7 @@ List of what the agent might say to users. See the [Expected Agent Responses](/g
4344
4515
  <dl>
4345
4516
  <dd>
4346
4517
 
4347
- **use_case:** `Pinnacle::Campaigns::Rcs::Types::RcsUseCase` — Use case classification for the campaign.
4518
+ **use_case_description:** `String` — Detailed summary of what the brand is and how this agent will be used. See the [Use Case Behavior](/guides/campaigns/rcs-compliance#use-case-behavior) section for requirements.
4348
4519
 
4349
4520
  </dd>
4350
4521
  </dl>
@@ -4352,7 +4523,7 @@ List of what the agent might say to users. See the [Expected Agent Responses](/g
4352
4523
  <dl>
4353
4524
  <dd>
4354
4525
 
4355
- **opt_in_terms_and_conditions:** `String` — Details on how opt-in is acquired. If it is done through a website or app, provide the link. See the [Opt-In Terms and Conditions](/guides/campaigns/rcs-compliance#opt-in-terms-and-conditions) section for requirements.
4526
+ **messaging_type:** `Pinnacle::Types::RcsMessagingTypeEnum`
4356
4527
 
4357
4528
  </dd>
4358
4529
  </dl>
@@ -4360,7 +4531,7 @@ List of what the agent might say to users. See the [Expected Agent Responses](/g
4360
4531
  <dl>
4361
4532
  <dd>
4362
4533
 
4363
- **messaging_type:** `Pinnacle::Types::RcsMessagingTypeEnum`
4534
+ **cta_media:** `String` — URL to the opt-in form or a URL to a screenshot of the opt-in CTA.
4364
4535
 
4365
4536
  </dd>
4366
4537
  </dl>
@@ -4368,7 +4539,7 @@ List of what the agent might say to users. See the [Expected Agent Responses](/g
4368
4539
  <dl>
4369
4540
  <dd>
4370
4541
 
4371
- **carrier_description:** `String` — Description of the agent's purpose, shown to carriers for approval. See the [Carrier Description](/guides/campaigns/rcs-compliance#carrier-description) section for requirements.
4542
+ **opt_in_method:** `String` — Details on how opt-in is acquired. If it is done through a website or app, provide the link. See the [Opt-In Method](/guides/campaigns/rcs-compliance#opt-in-method) section for requirements.
4372
4543
 
4373
4544
  </dd>
4374
4545
  </dl>
@@ -4392,30 +4563,6 @@ List of what the agent might say to users. See the [Expected Agent Responses](/g
4392
4563
  <dl>
4393
4564
  <dd>
4394
4565
 
4395
- **agent_triggers:** `String` — Explanation of how the agent is triggered. This includes how the first message is delivered, whether messages follow a schedule or triggered by user actions, and any external triggers. See the [Agent Triggers](/guides/campaigns/rcs-compliance#agent-triggers) section for requirements.
4396
-
4397
- </dd>
4398
- </dl>
4399
-
4400
- <dl>
4401
- <dd>
4402
-
4403
- **interaction_description:** `String` — Description of all agent interactions, including primary and secondary use cases. See the [Interaction Description](/guides/campaigns/rcs-compliance#interaction-description) section for requirements.
4404
-
4405
- </dd>
4406
- </dl>
4407
-
4408
- <dl>
4409
- <dd>
4410
-
4411
- **is_conversational:** `Internal::Types::Boolean` — Whether the agent supports conversational flows or respond to P2A messages from the users. Set to false for one-way messages from agent to user.
4412
-
4413
- </dd>
4414
- </dl>
4415
-
4416
- <dl>
4417
- <dd>
4418
-
4419
4566
  **cta_language:** `String` — Required text that appears next to the opt-in checkbox for your opt-in form. This checkbox has to be unchecked by default. See the [CTA Language](/guides/campaigns/rcs-compliance#cta-language-opt-in-disclosure) section for requirements.
4420
4567
 
4421
4568
  </dd>
@@ -5750,168 +5897,6 @@ client.messages.blasts.list();
5750
5897
  </dl>
5751
5898
 
5752
5899
 
5753
- </dd>
5754
- </dl>
5755
- </details>
5756
-
5757
- ## PhoneNumbers Webhook
5758
- <details><summary><code>client.phone_numbers.webhook.<a href="/lib/pinnacle/phone_numbers/webhook/client.rb">attach</a>(phone, request) -> Pinnacle::Types::ConfiguredWebhook</code></summary>
5759
- <dl>
5760
- <dd>
5761
-
5762
- #### 📝 Description
5763
-
5764
- <dl>
5765
- <dd>
5766
-
5767
- <dl>
5768
- <dd>
5769
-
5770
- Connect a webhook to your phone number to receive real-time notifications for incoming messages, delivery status updates, and other communication events.
5771
- </dd>
5772
- </dl>
5773
- </dd>
5774
- </dl>
5775
-
5776
- #### 🔌 Usage
5777
-
5778
- <dl>
5779
- <dd>
5780
-
5781
- <dl>
5782
- <dd>
5783
-
5784
- ```ruby
5785
- client.phone_numbers.webhook.attach(
5786
- phone: '%2B14155551234',
5787
- webhook_id: 'wh_1234567890',
5788
- event: 'MESSAGE.STATUS'
5789
- );
5790
- ```
5791
- </dd>
5792
- </dl>
5793
- </dd>
5794
- </dl>
5795
-
5796
- #### ⚙️ Parameters
5797
-
5798
- <dl>
5799
- <dd>
5800
-
5801
- <dl>
5802
- <dd>
5803
-
5804
- **phone:** `String`
5805
-
5806
- The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
5807
-
5808
- Must be a phone number that you own and have already [purchased](./buy) through the API. A phone number can have multiple webhooks attached to it.
5809
-
5810
- </dd>
5811
- </dl>
5812
-
5813
- <dl>
5814
- <dd>
5815
-
5816
- **request:** `Pinnacle::Types::AttachWebhookParams`
5817
-
5818
- </dd>
5819
- </dl>
5820
-
5821
- <dl>
5822
- <dd>
5823
-
5824
- **request_options:** `Pinnacle::PhoneNumbers::Webhook::RequestOptions`
5825
-
5826
- </dd>
5827
- </dl>
5828
- </dd>
5829
- </dl>
5830
-
5831
-
5832
- </dd>
5833
- </dl>
5834
- </details>
5835
-
5836
- <details><summary><code>client.phone_numbers.webhook.<a href="/lib/pinnacle/phone_numbers/webhook/client.rb">detach</a>(phone, webhook_id) -> Pinnacle::Types::DetachedWebhookInfo</code></summary>
5837
- <dl>
5838
- <dd>
5839
-
5840
- #### 📝 Description
5841
-
5842
- <dl>
5843
- <dd>
5844
-
5845
- <dl>
5846
- <dd>
5847
-
5848
- Disconnect a webhook from your phone number to stop receiving event notifications for that specific number. <br>
5849
-
5850
- The webhook configuration itself remains intact and available for use with other phone numbers.
5851
- </dd>
5852
- </dl>
5853
- </dd>
5854
- </dl>
5855
-
5856
- #### 🔌 Usage
5857
-
5858
- <dl>
5859
- <dd>
5860
-
5861
- <dl>
5862
- <dd>
5863
-
5864
- ```ruby
5865
- client.phone_numbers.webhook.detach(
5866
- phone: '+14155551234',
5867
- webhook_id: 'wh_1234567890'
5868
- );
5869
- ```
5870
- </dd>
5871
- </dl>
5872
- </dd>
5873
- </dl>
5874
-
5875
- #### ⚙️ Parameters
5876
-
5877
- <dl>
5878
- <dd>
5879
-
5880
- <dl>
5881
- <dd>
5882
-
5883
- **phone:** `String`
5884
-
5885
- The phone number you want to attach the webhook to in E.164 format. Make sure it is url encoded (i.e. replace the leading + with %2B). <br>
5886
-
5887
- Must be a phone number that you own and currently has the specified webhook attached.
5888
-
5889
- </dd>
5890
- </dl>
5891
-
5892
- <dl>
5893
- <dd>
5894
-
5895
- **webhook_id:** `String`
5896
-
5897
- The unique identifier of the webhook you want to detach from the phone number. <br>
5898
-
5899
- This must be a valid webhook ID that is currently attached to the specified phone number. This identifier is a string that always begins with the prefix `wh_`, for example: `wh_1234567890`.
5900
-
5901
- </dd>
5902
- </dl>
5903
-
5904
- <dl>
5905
- <dd>
5906
-
5907
- **request_options:** `Pinnacle::PhoneNumbers::Webhook::RequestOptions`
5908
-
5909
- </dd>
5910
- </dl>
5911
- </dd>
5912
- </dl>
5913
-
5914
-
5915
5900
  </dd>
5916
5901
  </dl>
5917
5902
  </details>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.14
4
+ version: 2.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pinnacle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-26 00:00:00.000000000 Z
11
+ date: 2026-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Pinnacle Ruby library provides convenient access to the Pinnacle
14
14
  API from Ruby.
@@ -72,7 +72,6 @@ files:
72
72
  - lib/pinnacle/campaigns/rcs/types/rcs_campaign_opt_out_keywords.rb
73
73
  - lib/pinnacle/campaigns/rcs/types/rcs_campaign_traffic.rb
74
74
  - lib/pinnacle/campaigns/rcs/types/rcs_links.rb
75
- - lib/pinnacle/campaigns/rcs/types/rcs_use_case.rb
76
75
  - lib/pinnacle/campaigns/rcs/types/upsert_rcs_campaign_params.rb
77
76
  - lib/pinnacle/campaigns/toll_free/client.rb
78
77
  - lib/pinnacle/campaigns/toll_free/types/list_toll_free_campaigns_params.rb
@@ -186,7 +185,6 @@ files:
186
185
  - lib/pinnacle/phone_numbers/types/search_phone_number_by_location.rb
187
186
  - lib/pinnacle/phone_numbers/types/search_phone_number_options.rb
188
187
  - lib/pinnacle/phone_numbers/types/search_phone_number_params.rb
189
- - lib/pinnacle/phone_numbers/webhook/client.rb
190
188
  - lib/pinnacle/pinnacle_client.rb
191
189
  - lib/pinnacle/rcs/agents/client.rb
192
190
  - lib/pinnacle/rcs/agents/types/list_agents_params.rb
@@ -239,9 +237,8 @@ files:
239
237
  - lib/pinnacle/types/agent_summary_config_websites_item.rb
240
238
  - lib/pinnacle/types/agent_use_case.rb
241
239
  - lib/pinnacle/types/agent_website_entry.rb
242
- - lib/pinnacle/types/attach_webhook_by_id_params.rb
243
- - lib/pinnacle/types/attach_webhook_params.rb
244
240
  - lib/pinnacle/types/attach_webhook_response_webhook.rb
241
+ - lib/pinnacle/types/attach_webhook_result.rb
245
242
  - lib/pinnacle/types/attached_phone_number_result.rb
246
243
  - lib/pinnacle/types/audience_count_only.rb
247
244
  - lib/pinnacle/types/audience_summary.rb
@@ -282,7 +279,6 @@ files:
282
279
  - lib/pinnacle/types/company_entity_type_enum.rb
283
280
  - lib/pinnacle/types/company_sector_enum.rb
284
281
  - lib/pinnacle/types/company_type_enum.rb
285
- - lib/pinnacle/types/configured_webhook.rb
286
282
  - lib/pinnacle/types/contact.rb
287
283
  - lib/pinnacle/types/contact_id.rb
288
284
  - lib/pinnacle/types/conversation.rb
@@ -291,11 +287,10 @@ files:
291
287
  - lib/pinnacle/types/conversation_contact.rb
292
288
  - lib/pinnacle/types/conversation_list.rb
293
289
  - lib/pinnacle/types/conversation_sender.rb
294
- - lib/pinnacle/types/create_and_attach_webhook_by_url_params.rb
295
290
  - lib/pinnacle/types/create_url_options.rb
296
291
  - lib/pinnacle/types/delete_audience_response.rb
292
+ - lib/pinnacle/types/detach_webhook_result.rb
297
293
  - lib/pinnacle/types/detached_phone_number_result.rb
298
- - lib/pinnacle/types/detached_webhook_info.rb
299
294
  - lib/pinnacle/types/detailed_phone_number_enum.rb
300
295
  - lib/pinnacle/types/dlc_assignment_status_enum.rb
301
296
  - lib/pinnacle/types/dlc_campaign_status.rb
@@ -318,6 +313,7 @@ files:
318
313
  - lib/pinnacle/types/extended_brand.rb
319
314
  - lib/pinnacle/types/extended_brand_with_vetting.rb
320
315
  - lib/pinnacle/types/extended_rcs_campaign.rb
316
+ - lib/pinnacle/types/failed_sender.rb
321
317
  - lib/pinnacle/types/fallback_message.rb
322
318
  - lib/pinnacle/types/get_conversation_params.rb
323
319
  - lib/pinnacle/types/get_dlc_campaign_status_response_updates.rb
@@ -435,18 +431,15 @@ files:
435
431
  - lib/pinnacle/types/rcs_campaign_schema_extra_keywords_opt_out.rb
436
432
  - lib/pinnacle/types/rcs_campaign_schema_extra_links.rb
437
433
  - lib/pinnacle/types/rcs_campaign_schema_extra_traffic.rb
438
- - lib/pinnacle/types/rcs_campaign_schema_extra_use_case.rb
439
434
  - lib/pinnacle/types/rcs_campaign_schema_keywords.rb
440
435
  - lib/pinnacle/types/rcs_campaign_schema_keywords_help.rb
441
436
  - lib/pinnacle/types/rcs_campaign_schema_keywords_opt_in.rb
442
437
  - lib/pinnacle/types/rcs_campaign_schema_keywords_opt_out.rb
443
438
  - lib/pinnacle/types/rcs_campaign_schema_links.rb
444
439
  - lib/pinnacle/types/rcs_campaign_schema_traffic.rb
445
- - lib/pinnacle/types/rcs_campaign_schema_use_case.rb
446
440
  - lib/pinnacle/types/rcs_campaign_status.rb
447
441
  - lib/pinnacle/types/rcs_campaign_summary.rb
448
442
  - lib/pinnacle/types/rcs_campaign_summary_status.rb
449
- - lib/pinnacle/types/rcs_campaign_use_case_enum.rb
450
443
  - lib/pinnacle/types/rcs_capabilities_result.rb
451
444
  - lib/pinnacle/types/rcs_capability.rb
452
445
  - lib/pinnacle/types/rcs_capability_actions.rb
@@ -564,6 +557,8 @@ files:
564
557
  - lib/pinnacle/types/zod_error.rb
565
558
  - lib/pinnacle/version.rb
566
559
  - lib/pinnacle/webhooks/client.rb
560
+ - lib/pinnacle/webhooks/types/attach_webhook_params.rb
561
+ - lib/pinnacle/webhooks/types/detach_webhook_params.rb
567
562
  - lib/pinnacle/webhooks/types/get_webhook_params.rb
568
563
  - lib/pinnacle/webhooks/types/list_webhooks_params.rb
569
564
  - lib/pinnacle/webhooks/types/list_webhooks_request_status.rb
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Campaigns
5
- module Rcs
6
- module Types
7
- # Use case classification for the campaign.
8
- class RcsUseCase < Internal::Types::Model
9
- field :behavior, -> { String }, optional: true, nullable: false
10
- field :value, -> { Pinnacle::Types::RcsCampaignUseCaseEnum }, optional: true, nullable: false
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,90 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module PhoneNumbers
5
- module Webhook
6
- class Client
7
- # @param client [Pinnacle::Internal::Http::RawClient]
8
- #
9
- # @return [void]
10
- def initialize(client:)
11
- @client = client
12
- end
13
-
14
- # Connect a webhook to your phone number to receive real-time notifications for incoming messages, delivery
15
- # status updates, and other communication events.
16
- #
17
- # @param request_options [Hash]
18
- # @param params [Pinnacle::Types::AttachWebhookParams]
19
- # @option request_options [String] :base_url
20
- # @option request_options [Hash{String => Object}] :additional_headers
21
- # @option request_options [Hash{String => Object}] :additional_query_parameters
22
- # @option request_options [Hash{String => Object}] :additional_body_parameters
23
- # @option request_options [Integer] :timeout_in_seconds
24
- # @option params [String] :phone
25
- #
26
- # @return [Pinnacle::Types::ConfiguredWebhook]
27
- def attach(request_options: {}, **params)
28
- params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
29
- request = Pinnacle::Internal::JSON::Request.new(
30
- base_url: request_options[:base_url],
31
- method: "POST",
32
- path: "phone-numbers/#{params[:phone]}/attach-webhook",
33
- body: Pinnacle::Types::AttachWebhookParams.new(params).to_h,
34
- request_options: request_options
35
- )
36
- begin
37
- response = @client.send(request)
38
- rescue Net::HTTPRequestTimeout
39
- raise Pinnacle::Errors::TimeoutError
40
- end
41
- code = response.code.to_i
42
- if code.between?(200, 299)
43
- Pinnacle::Types::ConfiguredWebhook.load(response.body)
44
- else
45
- error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
46
- raise error_class.new(response.body, code: code)
47
- end
48
- end
49
-
50
- # Disconnect a webhook from your phone number to stop receiving event notifications for that specific number.
51
- # <br>
52
- #
53
- # The webhook configuration itself remains intact and available for use with other phone numbers.
54
- #
55
- # @param request_options [Hash]
56
- # @param params [Hash]
57
- # @option request_options [String] :base_url
58
- # @option request_options [Hash{String => Object}] :additional_headers
59
- # @option request_options [Hash{String => Object}] :additional_query_parameters
60
- # @option request_options [Hash{String => Object}] :additional_body_parameters
61
- # @option request_options [Integer] :timeout_in_seconds
62
- # @option params [String] :phone
63
- # @option params [String] :webhook_id
64
- #
65
- # @return [Pinnacle::Types::DetachedWebhookInfo]
66
- def detach(request_options: {}, **params)
67
- params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
68
- request = Pinnacle::Internal::JSON::Request.new(
69
- base_url: request_options[:base_url],
70
- method: "DELETE",
71
- path: "phone-numbers/#{params[:phone]}/detach-webhook/#{params[:webhook_id]}",
72
- request_options: request_options
73
- )
74
- begin
75
- response = @client.send(request)
76
- rescue Net::HTTPRequestTimeout
77
- raise Pinnacle::Errors::TimeoutError
78
- end
79
- code = response.code.to_i
80
- if code.between?(200, 299)
81
- Pinnacle::Types::DetachedWebhookInfo.load(response.body)
82
- else
83
- error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
84
- raise error_class.new(response.body, code: code)
85
- end
86
- end
87
- end
88
- end
89
- end
90
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Attach a webhook you've already created in your account to this phone number.
6
- class AttachWebhookByIdParams < Internal::Types::Model
7
- field :webhook_id, -> { String }, optional: false, nullable: false, api_name: "webhookId"
8
- field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: false, nullable: true
9
- end
10
- end
11
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Use this request to connect a webhook to your phone number and receive real-time event notifications.
6
- # You can either attach one of your existing webhooks by providing its ID or create a new webhook by specifying its
7
- # name, URL, and event type.
8
- class AttachWebhookParams < Internal::Types::Model
9
- extend Pinnacle::Internal::Types::Union
10
-
11
- member -> { Pinnacle::Types::AttachWebhookByIdParams }
12
- member -> { Pinnacle::Types::CreateAndAttachWebhookByUrlParams }
13
- end
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Confirmation that a webhook has been successfully attached to the specified phone number.
6
- # Includes detailed webhook information, the subscribed event type, and the associated phone number.
7
- class ConfiguredWebhook < Internal::Types::Model
8
- field :webhook, -> { Pinnacle::Types::AttachWebhookResponseWebhook }, optional: false, nullable: false
9
- field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: false, nullable: false
10
- field :phone_number, -> { String }, optional: false, nullable: false, api_name: "phoneNumber"
11
- end
12
- end
13
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Create a new webhook and immediately attach it to your phone number.
6
- class CreateAndAttachWebhookByUrlParams < Internal::Types::Model
7
- field :name, -> { String }, optional: false, nullable: false
8
- field :url, -> { String }, optional: false, nullable: false
9
- field :event, -> { Pinnacle::Types::WebhookEventEnum }, optional: false, nullable: true
10
- end
11
- end
12
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- class DetachedWebhookInfo < Internal::Types::Model
6
- field :message, -> { String }, optional: false, nullable: false
7
- field :webhook_id, -> { String }, optional: false, nullable: false, api_name: "webhookId"
8
- field :phone_number, -> { String }, optional: false, nullable: false, api_name: "phoneNumber"
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Use case classification for the campaign.
6
- class RcsCampaignSchemaExtraUseCase < Internal::Types::Model
7
- field :behavior, -> { String }, optional: true, nullable: false
8
- field :value, -> { Pinnacle::Types::RcsCampaignUseCaseEnum }, optional: true, nullable: false
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Use case classification for the campaign.
6
- class RcsCampaignSchemaUseCase < Internal::Types::Model
7
- field :behavior, -> { String }, optional: true, nullable: false
8
- field :value, -> { Pinnacle::Types::RcsCampaignUseCaseEnum }, optional: true, nullable: false
9
- end
10
- end
11
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- module RcsCampaignUseCaseEnum
6
- extend Pinnacle::Internal::Types::Enum
7
-
8
- ADVERTISING_MARKETING = "ADVERTISING_MARKETING"
9
- ARTS_AND_ENTERTAINMENT = "ARTS_AND_ENTERTAINMENT"
10
- BFSI = "BFSI"
11
- COMMERCIAL_AND_INDUSTRIAL = "COMMERCIAL_AND_INDUSTRIAL"
12
- COMMUNITY_ORGANIZATIONS = "COMMUNITY_ORGANIZATIONS"
13
- CREDIT_RATING = "CREDIT_RATING"
14
- DELIVERY_PARTNER = "DELIVERY_PARTNER"
15
- EDUCATION = "EDUCATION"
16
- FINANCE = "FINANCE"
17
- FOOD_AND_BEVERAGE = "FOOD_AND_BEVERAGE"
18
- GAMING = "GAMING"
19
- GOVERNMENT = "GOVERNMENT"
20
- HEALTH = "HEALTH"
21
- HOTEL_AND_BNB = "HOTEL_AND_BNB"
22
- INSURANCE = "INSURANCE"
23
- LEGAL = "LEGAL"
24
- LENDING = "LENDING"
25
- LOANS = "LOANS"
26
- LOCAL_SERVICES = "LOCAL_SERVICES"
27
- NEWS = "NEWS"
28
- NON_GOVERNMENTAL_ORGANIZATIONS = "NON_GOVERNMENTAL_ORGANIZATIONS"
29
- NON_PROFIT_ORGANIZATIONS = "NON_PROFIT_ORGANIZATIONS"
30
- ONLINE_SELLER = "ONLINE_SELLER"
31
- OTHER = "OTHER"
32
- PRODUCTIVITY = "PRODUCTIVITY"
33
- PROPERTY = "PROPERTY"
34
- SCIENCE_TECHNOLOGY_ENGINEERING = "SCIENCE_TECHNOLOGY_ENGINEERING"
35
- SHOPPING_AND_RETAIL = "SHOPPING_AND_RETAIL"
36
- SOCIAL = "SOCIAL"
37
- SPORTS = "SPORTS"
38
- TELECOMMUNICATIONS = "TELECOMMUNICATIONS"
39
- TRAVEL = "TRAVEL"
40
- UTILITIES = "UTILITIES"
41
- end
42
- end
43
- end