rcs 2.0.14 → 2.0.16
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.
- checksums.yaml +4 -4
- data/.fern/metadata.json +4 -3
- data/.rubocop.yml +19 -0
- data/lib/pinnacle/campaigns/rcs/types/upsert_rcs_campaign_params.rb +3 -6
- data/lib/pinnacle/client.rb +1 -1
- data/lib/pinnacle/internal/types/boolean.rb +1 -1
- data/lib/pinnacle/internal/types/utils.rb +2 -2
- data/lib/pinnacle/messages/client.rb +5 -0
- data/lib/pinnacle/messages/simulate/client.rb +50 -0
- data/lib/pinnacle/phone_numbers/client.rb +0 -5
- data/lib/pinnacle/types/attach_webhook_response_webhook.rb +2 -2
- data/lib/pinnacle/types/attach_webhook_result.rb +12 -0
- data/lib/pinnacle/types/detach_webhook_result.rb +11 -0
- data/lib/pinnacle/types/extended_brand_with_vetting.rb +2 -2
- data/lib/pinnacle/types/extended_rcs_campaign.rb +3 -6
- data/lib/pinnacle/types/failed_sender.rb +10 -0
- data/lib/pinnacle/types/rcs_campaign.rb +3 -6
- data/lib/pinnacle/types/rcs_campaign_summary.rb +0 -1
- data/lib/pinnacle/types/rcs_cards_content.rb +1 -1
- data/lib/pinnacle/types/rcs_cards_content_cards_item.rb +1 -1
- data/lib/pinnacle/types/rcs_media_content.rb +1 -1
- data/lib/pinnacle/types/rcs_validate_content_media.rb +1 -1
- data/lib/pinnacle/types/rich_card.rb +1 -1
- data/lib/pinnacle/types/rich_cards.rb +1 -1
- data/lib/pinnacle/types/rich_media_message.rb +1 -1
- data/lib/pinnacle/types/rich_text.rb +1 -1
- data/lib/pinnacle/types/send_rich_cards_options.rb +5 -0
- data/lib/pinnacle/types/send_rich_message_options_4.rb +13 -0
- data/lib/pinnacle/types/simulate_message_input.rb +12 -0
- data/lib/pinnacle/types/simulate_user_button.rb +12 -0
- data/lib/pinnacle/types/simulate_user_message.rb +12 -0
- data/lib/pinnacle/types/simulate_user_params.rb +13 -0
- data/lib/pinnacle/types/simulate_user_response.rb +10 -0
- data/lib/pinnacle/types/user_button_press.rb +19 -0
- data/lib/pinnacle/types/user_button_press_call.rb +12 -0
- data/lib/pinnacle/types/user_button_press_open_url.rb +12 -0
- data/lib/pinnacle/types/user_button_press_request_user_location.rb +12 -0
- data/lib/pinnacle/types/user_button_press_request_user_location_location.rb +13 -0
- data/lib/pinnacle/types/user_button_press_schedule_event.rb +15 -0
- data/lib/pinnacle/types/user_button_press_send_location.rb +13 -0
- data/lib/pinnacle/types/user_button_press_send_location_lat_long.rb +11 -0
- data/lib/pinnacle/types/user_button_press_trigger.rb +12 -0
- data/lib/pinnacle/types/vcard_content.rb +1 -1
- data/lib/pinnacle/types/webhook_event_enum.rb +1 -0
- data/lib/pinnacle/types/webhook_summary.rb +1 -0
- data/lib/pinnacle/types/webhooks.rb +1 -0
- data/lib/pinnacle/version.rb +1 -1
- data/lib/pinnacle/webhooks/client.rb +85 -0
- data/lib/pinnacle/webhooks/types/attach_webhook_params.rb +16 -0
- data/lib/pinnacle/webhooks/types/detach_webhook_params.rb +12 -0
- data/lib/pinnacle.rb +23 -12
- data/reference.md +223 -151
- metadata +23 -12
- data/lib/pinnacle/campaigns/rcs/types/rcs_use_case.rb +0 -15
- data/lib/pinnacle/phone_numbers/webhook/client.rb +0 -90
- data/lib/pinnacle/types/attach_webhook_by_id_params.rb +0 -11
- data/lib/pinnacle/types/attach_webhook_params.rb +0 -15
- data/lib/pinnacle/types/configured_webhook.rb +0 -13
- data/lib/pinnacle/types/create_and_attach_webhook_by_url_params.rb +0 -12
- data/lib/pinnacle/types/detached_webhook_info.rb +0 -11
- data/lib/pinnacle/types/rcs_campaign_schema_extra_use_case.rb +0 -11
- data/lib/pinnacle/types/rcs_campaign_schema_use_case.rb +0 -11
- data/lib/pinnacle/types/rcs_campaign_use_case_enum.rb +0 -43
|
@@ -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
|