rcs 2.0.0.pre.rc.5 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rcs/brands/client.rb +36 -24
- data/lib/rcs/campaigns/dlc/client.rb +36 -26
- data/lib/rcs/campaigns/rcs/client.rb +26 -22
- data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +6 -6
- data/lib/rcs/campaigns/toll_free/client.rb +32 -26
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +6 -6
- data/lib/rcs/contacts/client.rb +10 -8
- data/lib/rcs/conversations/client.rb +144 -16
- data/lib/rcs/conversations/types/conversations_list_messages_request_direction.rb +12 -0
- data/lib/rcs/conversations/types/conversations_list_messages_request_sort_order.rb +12 -0
- data/lib/rcs/conversations/types/conversations_list_messages_request_status.rb +17 -0
- data/lib/rcs/conversations/types/conversations_list_messages_request_type.rb +13 -0
- data/lib/rcs/messages/client.rb +12 -29
- data/lib/rcs/messages/rcs/client.rb +125 -1
- data/lib/rcs/messages/rcs/types/send_typing_indicator_schema_options.rb +66 -0
- data/lib/rcs/phone_numbers/campaign/client.rb +20 -6
- data/lib/rcs/phone_numbers/client.rb +0 -14
- data/lib/rcs/phone_numbers/webhook/client.rb +12 -10
- data/lib/rcs/rcs/client.rb +32 -18
- data/lib/rcs/status/get/client.rb +32 -16
- data/lib/rcs/tools/contact_card/client.rb +18 -8
- data/lib/rcs/tools/file/client.rb +92 -2
- data/lib/rcs/tools/file/types/upload_file_options.rb +21 -3
- data/lib/rcs/tools/url/client.rb +4 -2
- data/lib/rcs/types/attach_webhook_by_id_params.rb +5 -5
- data/lib/rcs/types/attach_webhook_response_webhook.rb +5 -3
- data/lib/rcs/types/autofill_campaign_params.rb +15 -3
- data/lib/rcs/types/autofill_dlc_campaign_response.rb +10 -6
- data/lib/rcs/types/autofill_dlc_response_keywords.rb +8 -10
- data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +3 -3
- data/lib/rcs/types/autofill_dlc_response_keywords_opt_in.rb +6 -4
- data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +3 -3
- data/lib/rcs/types/autofill_dlc_response_options.rb +12 -12
- data/lib/rcs/types/brand_status.rb +5 -3
- data/lib/rcs/types/{inbound_button.rb → button_clicked.rb} +7 -7
- data/lib/rcs/types/button_clicked_data.rb +80 -0
- data/lib/rcs/types/button_clicked_data_button.rb +118 -0
- data/lib/rcs/types/{click_action_data.rb → button_clicked_data_button_raw.rb} +10 -8
- data/lib/rcs/types/button_clicked_data_button_type.rb +15 -0
- data/lib/rcs/types/campaign_query.rb +10 -2
- data/lib/rcs/types/contact.rb +5 -3
- data/lib/rcs/types/contact_id.rb +5 -3
- data/lib/rcs/types/conversation.rb +16 -8
- data/lib/rcs/types/conversation_by_id_params.rb +7 -3
- data/lib/rcs/types/conversation_contact.rb +5 -3
- data/lib/rcs/types/conversation_list.rb +50 -28
- data/lib/rcs/types/create_url_options.rb +4 -2
- data/lib/rcs/types/detached_webhook_info.rb +5 -3
- data/lib/rcs/types/dlc_campaign_status.rb +5 -3
- data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +21 -19
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +3 -3
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_in.rb +6 -4
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_out.rb +6 -4
- data/lib/rcs/types/extended_brand.rb +25 -13
- data/lib/rcs/types/extended_brand_with_vetting.rb +25 -13
- data/lib/rcs/types/extended_rcs_campaign.rb +25 -14
- data/lib/rcs/types/link_click_event.rb +1 -17
- data/lib/rcs/types/message.rb +5 -3
- data/lib/rcs/types/message_content.rb +4 -4
- data/lib/rcs/types/message_event.rb +143 -0
- data/lib/rcs/types/message_event_content.rb +127 -0
- data/lib/rcs/types/message_event_conversation.rb +82 -0
- data/lib/rcs/types/message_event_direction.rb +11 -0
- data/lib/rcs/types/message_event_mms_content.rb +94 -0
- data/lib/rcs/types/message_event_rcs_button_data.rb +104 -0
- data/lib/rcs/types/message_event_rcs_cards_content.rb +99 -0
- data/lib/rcs/types/message_event_rcs_cards_content_cards_item.rb +94 -0
- data/lib/rcs/types/message_event_rcs_location_data.rb +91 -0
- data/lib/rcs/types/message_event_rcs_media_content.rb +94 -0
- data/lib/rcs/types/message_event_rcs_text_content.rb +92 -0
- data/lib/rcs/types/message_event_sms_content.rb +81 -0
- data/lib/rcs/types/{retrieved_conversations.rb → message_list.rb} +26 -25
- data/lib/rcs/types/message_with_reaction.rb +197 -0
- data/lib/rcs/types/message_with_reaction_direction.rb +11 -0
- data/lib/rcs/types/{error_response.rb → not_found_error_body.rb} +7 -7
- data/lib/rcs/types/options.rb +111 -0
- data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +7 -3
- data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +7 -3
- data/lib/rcs/types/pinnacle_file_upload_metadata.rb +18 -2
- data/lib/rcs/types/profile_status_enum.rb +4 -4
- data/lib/rcs/types/rcs_base_options.rb +12 -1
- data/lib/rcs/types/rcs_button_call.rb +11 -2
- data/lib/rcs/types/rcs_button_open_url.rb +38 -2
- data/lib/rcs/types/rcs_button_open_url_webview_mode.rb +19 -0
- data/lib/rcs/types/rcs_button_request_user_location.rb +15 -3
- data/lib/rcs/types/rcs_button_schedule_event.rb +9 -1
- data/lib/rcs/types/rcs_button_send_location.rb +22 -2
- data/lib/rcs/types/rcs_button_trigger.rb +8 -6
- data/lib/rcs/types/rcs_campaign.rb +3 -3
- data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +8 -8
- data/lib/rcs/types/rcs_campaign_status.rb +5 -3
- data/lib/rcs/types/reaction_result.rb +10 -6
- data/lib/rcs/types/refreshed_file.rb +67 -0
- data/lib/rcs/types/rich_cards_message.rb +10 -10
- data/lib/rcs/types/{rcs.rb → rich_message.rb} +3 -3
- data/lib/rcs/types/scheduled_messaage.rb +5 -3
- data/lib/rcs/types/send_rcs_card_options.rb +132 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card.rb +78 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card_image_alignment.rb +12 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card_orientation.rb +11 -0
- data/lib/rcs/types/send_typing_indicator_response.rb +100 -0
- data/lib/rcs/types/sent_mms_details.rb +4 -2
- data/lib/rcs/types/sent_rcs_details.rb +12 -13
- data/lib/rcs/types/sent_sms_details.rb +5 -3
- data/lib/rcs/types/toll_free_campaign.rb +3 -3
- data/lib/rcs/types/toll_free_campaign_status.rb +5 -3
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +3 -5
- data/lib/rcs/types/updated_contact_id.rb +5 -3
- data/lib/rcs/types/user_event.rb +83 -0
- data/lib/rcs/types/user_event_conversation.rb +78 -0
- data/lib/rcs/types/v_card_data.rb +5 -3
- data/lib/rcs/types/validate_campaign_params.rb +15 -3
- data/lib/rcs/types/vcard.rb +5 -3
- data/lib/rcs/types/vcard_content.rb +5 -3
- data/lib/rcs/types/vcard_resource.rb +5 -3
- data/lib/rcs/types/webhook_event_enum.rb +1 -0
- data/lib/rcs/types/webhooks.rb +5 -3
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +37 -7
- metadata +41 -11
- data/lib/rcs/types/click_action.rb +0 -73
- data/lib/rcs/types/click_action_data_metadata.rb +0 -69
|
@@ -23,11 +23,13 @@ module Pinnacle
|
|
|
23
23
|
# @param values [Array<String>] Keywords that trigger opt-in.
|
|
24
24
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
25
|
# @return [Pinnacle::Types::AutofillDlcResponseKeywordsOptIn]
|
|
26
|
-
def initialize(
|
|
27
|
-
@message = message
|
|
26
|
+
def initialize(values:, message: OMIT, additional_properties: nil)
|
|
27
|
+
@message = message if message != OMIT
|
|
28
28
|
@values = values
|
|
29
29
|
@additional_properties = additional_properties
|
|
30
|
-
@_field_set = { "message": message, "values": values }
|
|
30
|
+
@_field_set = { "message": message, "values": values }.reject do |_k, v|
|
|
31
|
+
v == OMIT
|
|
32
|
+
end
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
# Deserialize a JSON object to an instance of AutofillDlcResponseKeywordsOptIn
|
|
@@ -60,7 +62,7 @@ module Pinnacle
|
|
|
60
62
|
# @param obj [Object]
|
|
61
63
|
# @return [Void]
|
|
62
64
|
def self.validate_raw(obj:)
|
|
63
|
-
obj.message
|
|
65
|
+
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
|
64
66
|
obj.values.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
|
|
65
67
|
end
|
|
66
68
|
end
|
|
@@ -23,9 +23,9 @@ module Pinnacle
|
|
|
23
23
|
# @param values [Array<String>] Keywords that trigger opt-out.
|
|
24
24
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
25
|
# @return [Pinnacle::Types::AutofillDlcResponseKeywordsOptOut]
|
|
26
|
-
def initialize(message: OMIT,
|
|
26
|
+
def initialize(values:, message: OMIT, additional_properties: nil)
|
|
27
27
|
@message = message if message != OMIT
|
|
28
|
-
@values = values
|
|
28
|
+
@values = values
|
|
29
29
|
@additional_properties = additional_properties
|
|
30
30
|
@_field_set = { "message": message, "values": values }.reject do |_k, v|
|
|
31
31
|
v == OMIT
|
|
@@ -63,7 +63,7 @@ module Pinnacle
|
|
|
63
63
|
# @return [Void]
|
|
64
64
|
def self.validate_raw(obj:)
|
|
65
65
|
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
|
66
|
-
obj.values
|
|
66
|
+
obj.values.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
end
|
|
@@ -35,14 +35,14 @@ module Pinnacle
|
|
|
35
35
|
# @param number_pooling [Boolean] Whether the campaign uses number pooling.
|
|
36
36
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
37
37
|
# @return [Pinnacle::Types::AutofillDlcResponseOptions]
|
|
38
|
-
def initialize(affiliate_marketing
|
|
39
|
-
|
|
40
|
-
@affiliate_marketing = affiliate_marketing
|
|
41
|
-
@age_gated = age_gated
|
|
42
|
-
@direct_lending = direct_lending
|
|
38
|
+
def initialize(affiliate_marketing:, age_gated:, direct_lending:, embedded_phone:, number_pooling:,
|
|
39
|
+
embedded_link: OMIT, additional_properties: nil)
|
|
40
|
+
@affiliate_marketing = affiliate_marketing
|
|
41
|
+
@age_gated = age_gated
|
|
42
|
+
@direct_lending = direct_lending
|
|
43
43
|
@embedded_link = embedded_link if embedded_link != OMIT
|
|
44
|
-
@embedded_phone = embedded_phone
|
|
45
|
-
@number_pooling = number_pooling
|
|
44
|
+
@embedded_phone = embedded_phone
|
|
45
|
+
@number_pooling = number_pooling
|
|
46
46
|
@additional_properties = additional_properties
|
|
47
47
|
@_field_set = {
|
|
48
48
|
"affiliateMarketing": affiliate_marketing,
|
|
@@ -94,12 +94,12 @@ module Pinnacle
|
|
|
94
94
|
# @param obj [Object]
|
|
95
95
|
# @return [Void]
|
|
96
96
|
def self.validate_raw(obj:)
|
|
97
|
-
obj.affiliate_marketing
|
|
98
|
-
obj.age_gated
|
|
99
|
-
obj.direct_lending
|
|
97
|
+
obj.affiliate_marketing.is_a?(Boolean) != false || raise("Passed value for field obj.affiliate_marketing is not the expected type, validation failed.")
|
|
98
|
+
obj.age_gated.is_a?(Boolean) != false || raise("Passed value for field obj.age_gated is not the expected type, validation failed.")
|
|
99
|
+
obj.direct_lending.is_a?(Boolean) != false || raise("Passed value for field obj.direct_lending is not the expected type, validation failed.")
|
|
100
100
|
obj.embedded_link&.is_a?(String) != false || raise("Passed value for field obj.embedded_link is not the expected type, validation failed.")
|
|
101
|
-
obj.embedded_phone
|
|
102
|
-
obj.number_pooling
|
|
101
|
+
obj.embedded_phone.is_a?(Boolean) != false || raise("Passed value for field obj.embedded_phone is not the expected type, validation failed.")
|
|
102
|
+
obj.number_pooling.is_a?(Boolean) != false || raise("Passed value for field obj.number_pooling is not the expected type, validation failed.")
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
end
|
|
@@ -10,7 +10,8 @@ module Pinnacle
|
|
|
10
10
|
class BrandStatus
|
|
11
11
|
# @return [Array<String>] List of errors that occurred.
|
|
12
12
|
attr_reader :errors
|
|
13
|
-
# @return [
|
|
13
|
+
# @return [String] The unique identifier of the brand. This identifier is a string that always
|
|
14
|
+
# begins with the prefix `b_`, for example: `b_1234567890`.
|
|
14
15
|
attr_reader :id
|
|
15
16
|
# @return [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
|
|
16
17
|
# `INCOMPLETE`: Has not been submitted. Use the [submit
|
|
@@ -31,7 +32,8 @@ module Pinnacle
|
|
|
31
32
|
OMIT = Object.new
|
|
32
33
|
|
|
33
34
|
# @param errors [Array<String>] List of errors that occurred.
|
|
34
|
-
# @param id [
|
|
35
|
+
# @param id [String] The unique identifier of the brand. This identifier is a string that always
|
|
36
|
+
# begins with the prefix `b_`, for example: `b_1234567890`.
|
|
35
37
|
# @param status [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
|
|
36
38
|
# `INCOMPLETE`: Has not been submitted. Use the [submit
|
|
37
39
|
# endpoint](../brands/submit). <br>
|
|
@@ -84,7 +86,7 @@ module Pinnacle
|
|
|
84
86
|
# @return [Void]
|
|
85
87
|
def self.validate_raw(obj:)
|
|
86
88
|
obj.errors.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
|
87
|
-
obj.id.is_a?(
|
|
89
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
88
90
|
obj.status.is_a?(Pinnacle::Types::BrandStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
|
89
91
|
end
|
|
90
92
|
end
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
|
-
require_relative "
|
|
4
|
+
require_relative "button_clicked_data"
|
|
5
5
|
require_relative "location_share_action"
|
|
6
6
|
|
|
7
7
|
module Pinnacle
|
|
8
8
|
module Types
|
|
9
|
-
class
|
|
10
|
-
# Deserialize a JSON object to an instance of
|
|
9
|
+
class ButtonClicked
|
|
10
|
+
# Deserialize a JSON object to an instance of ButtonClicked
|
|
11
11
|
#
|
|
12
12
|
# @param json_object [String]
|
|
13
|
-
# @return [Pinnacle::Types::
|
|
13
|
+
# @return [Pinnacle::Types::ButtonClicked]
|
|
14
14
|
def self.from_json(json_object:)
|
|
15
15
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
16
16
|
begin
|
|
17
|
-
Pinnacle::Types::
|
|
18
|
-
return Pinnacle::Types::
|
|
17
|
+
Pinnacle::Types::ButtonClickedData.validate_raw(obj: struct)
|
|
18
|
+
return Pinnacle::Types::ButtonClickedData.from_json(json_object: struct) unless struct.nil?
|
|
19
19
|
|
|
20
20
|
return nil
|
|
21
21
|
rescue StandardError
|
|
@@ -40,7 +40,7 @@ module Pinnacle
|
|
|
40
40
|
# @return [Void]
|
|
41
41
|
def self.validate_raw(obj:)
|
|
42
42
|
begin
|
|
43
|
-
return Pinnacle::Types::
|
|
43
|
+
return Pinnacle::Types::ButtonClickedData.validate_raw(obj: obj)
|
|
44
44
|
rescue StandardError
|
|
45
45
|
# noop
|
|
46
46
|
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "button_clicked_data_button"
|
|
4
|
+
require "ostruct"
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module Pinnacle
|
|
8
|
+
module Types
|
|
9
|
+
# Unified data structure for button click events.
|
|
10
|
+
class ButtonClickedData
|
|
11
|
+
# @return [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
|
|
12
|
+
attr_reader :button
|
|
13
|
+
# @return [String] ID of the message this button was sent in, or null if not available. To get the
|
|
14
|
+
# message details, use the [GET /messages/{id}](/api-reference/messages/get)
|
|
15
|
+
# endpoint.
|
|
16
|
+
attr_reader :message_id
|
|
17
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
18
|
+
attr_reader :additional_properties
|
|
19
|
+
# @return [Object]
|
|
20
|
+
attr_reader :_field_set
|
|
21
|
+
protected :_field_set
|
|
22
|
+
|
|
23
|
+
OMIT = Object.new
|
|
24
|
+
|
|
25
|
+
# @param button [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
|
|
26
|
+
# @param message_id [String] ID of the message this button was sent in, or null if not available. To get the
|
|
27
|
+
# message details, use the [GET /messages/{id}](/api-reference/messages/get)
|
|
28
|
+
# endpoint.
|
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
# @return [Pinnacle::Types::ButtonClickedData]
|
|
31
|
+
def initialize(button:, message_id: OMIT, additional_properties: nil)
|
|
32
|
+
@button = button
|
|
33
|
+
@message_id = message_id if message_id != OMIT
|
|
34
|
+
@additional_properties = additional_properties
|
|
35
|
+
@_field_set = { "button": button, "messageId": message_id }.reject do |_k, v|
|
|
36
|
+
v == OMIT
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Deserialize a JSON object to an instance of ButtonClickedData
|
|
41
|
+
#
|
|
42
|
+
# @param json_object [String]
|
|
43
|
+
# @return [Pinnacle::Types::ButtonClickedData]
|
|
44
|
+
def self.from_json(json_object:)
|
|
45
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
46
|
+
parsed_json = JSON.parse(json_object)
|
|
47
|
+
if parsed_json["button"].nil?
|
|
48
|
+
button = nil
|
|
49
|
+
else
|
|
50
|
+
button = parsed_json["button"].to_json
|
|
51
|
+
button = Pinnacle::Types::ButtonClickedDataButton.from_json(json_object: button)
|
|
52
|
+
end
|
|
53
|
+
message_id = parsed_json["messageId"]
|
|
54
|
+
new(
|
|
55
|
+
button: button,
|
|
56
|
+
message_id: message_id,
|
|
57
|
+
additional_properties: struct
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Serialize an instance of ButtonClickedData to a JSON object
|
|
62
|
+
#
|
|
63
|
+
# @return [String]
|
|
64
|
+
def to_json(*_args)
|
|
65
|
+
@_field_set&.to_json
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
69
|
+
# hash and check each fields type against the current object's property
|
|
70
|
+
# definitions.
|
|
71
|
+
#
|
|
72
|
+
# @param obj [Object]
|
|
73
|
+
# @return [Void]
|
|
74
|
+
def self.validate_raw(obj:)
|
|
75
|
+
Pinnacle::Types::ButtonClickedDataButton.validate_raw(obj: obj.button)
|
|
76
|
+
obj.message_id&.is_a?(String) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "button_clicked_data_button_type"
|
|
4
|
+
require_relative "button_clicked_data_button_raw"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module Pinnacle
|
|
9
|
+
module Types
|
|
10
|
+
# Information about the button that was clicked.
|
|
11
|
+
class ButtonClickedDataButton
|
|
12
|
+
# @return [Pinnacle::Types::ButtonClickedDataButtonType] Type of button clicked.
|
|
13
|
+
# - `CARD` for card buttons,
|
|
14
|
+
# - `QUICK_REPLY` for quick replies.
|
|
15
|
+
# - `null` if we cannot determine the button type. This is a rare edge case and is
|
|
16
|
+
# mainly here for backward compatibility.
|
|
17
|
+
attr_reader :type
|
|
18
|
+
# @return [Pinnacle::Types::ButtonClickedDataButtonRaw] Raw button data. Contains the entire button that was clicked by the user. In
|
|
19
|
+
# rare cases where we cannot determine the exact button, this will return only the
|
|
20
|
+
# button title.
|
|
21
|
+
attr_reader :raw
|
|
22
|
+
# @return [String] Extracted payload from the button's `payload` field, if provided. Provides quick
|
|
23
|
+
# access to any payload that was attached to the button.
|
|
24
|
+
attr_reader :payload
|
|
25
|
+
# @return [String] Additional metadata attached to the button's `metadata` field, if provided.
|
|
26
|
+
attr_reader :metadata
|
|
27
|
+
# @return [Integer] Number of times the button has been clicked.
|
|
28
|
+
attr_reader :clicks
|
|
29
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
attr_reader :additional_properties
|
|
31
|
+
# @return [Object]
|
|
32
|
+
attr_reader :_field_set
|
|
33
|
+
protected :_field_set
|
|
34
|
+
|
|
35
|
+
OMIT = Object.new
|
|
36
|
+
|
|
37
|
+
# @param type [Pinnacle::Types::ButtonClickedDataButtonType] Type of button clicked.
|
|
38
|
+
# - `CARD` for card buttons,
|
|
39
|
+
# - `QUICK_REPLY` for quick replies.
|
|
40
|
+
# - `null` if we cannot determine the button type. This is a rare edge case and is
|
|
41
|
+
# mainly here for backward compatibility.
|
|
42
|
+
# @param raw [Pinnacle::Types::ButtonClickedDataButtonRaw] Raw button data. Contains the entire button that was clicked by the user. In
|
|
43
|
+
# rare cases where we cannot determine the exact button, this will return only the
|
|
44
|
+
# button title.
|
|
45
|
+
# @param payload [String] Extracted payload from the button's `payload` field, if provided. Provides quick
|
|
46
|
+
# access to any payload that was attached to the button.
|
|
47
|
+
# @param metadata [String] Additional metadata attached to the button's `metadata` field, if provided.
|
|
48
|
+
# @param clicks [Integer] Number of times the button has been clicked.
|
|
49
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
50
|
+
# @return [Pinnacle::Types::ButtonClickedDataButton]
|
|
51
|
+
def initialize(raw:, clicks:, type: OMIT, payload: OMIT, metadata: OMIT, additional_properties: nil)
|
|
52
|
+
@type = type if type != OMIT
|
|
53
|
+
@raw = raw
|
|
54
|
+
@payload = payload if payload != OMIT
|
|
55
|
+
@metadata = metadata if metadata != OMIT
|
|
56
|
+
@clicks = clicks
|
|
57
|
+
@additional_properties = additional_properties
|
|
58
|
+
@_field_set = {
|
|
59
|
+
"type": type,
|
|
60
|
+
"raw": raw,
|
|
61
|
+
"payload": payload,
|
|
62
|
+
"metadata": metadata,
|
|
63
|
+
"clicks": clicks
|
|
64
|
+
}.reject do |_k, v|
|
|
65
|
+
v == OMIT
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Deserialize a JSON object to an instance of ButtonClickedDataButton
|
|
70
|
+
#
|
|
71
|
+
# @param json_object [String]
|
|
72
|
+
# @return [Pinnacle::Types::ButtonClickedDataButton]
|
|
73
|
+
def self.from_json(json_object:)
|
|
74
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
75
|
+
parsed_json = JSON.parse(json_object)
|
|
76
|
+
type = parsed_json["type"]
|
|
77
|
+
if parsed_json["raw"].nil?
|
|
78
|
+
raw = nil
|
|
79
|
+
else
|
|
80
|
+
raw = parsed_json["raw"].to_json
|
|
81
|
+
raw = Pinnacle::Types::ButtonClickedDataButtonRaw.from_json(json_object: raw)
|
|
82
|
+
end
|
|
83
|
+
payload = parsed_json["payload"]
|
|
84
|
+
metadata = parsed_json["metadata"]
|
|
85
|
+
clicks = parsed_json["clicks"]
|
|
86
|
+
new(
|
|
87
|
+
type: type,
|
|
88
|
+
raw: raw,
|
|
89
|
+
payload: payload,
|
|
90
|
+
metadata: metadata,
|
|
91
|
+
clicks: clicks,
|
|
92
|
+
additional_properties: struct
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Serialize an instance of ButtonClickedDataButton to a JSON object
|
|
97
|
+
#
|
|
98
|
+
# @return [String]
|
|
99
|
+
def to_json(*_args)
|
|
100
|
+
@_field_set&.to_json
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
104
|
+
# hash and check each fields type against the current object's property
|
|
105
|
+
# definitions.
|
|
106
|
+
#
|
|
107
|
+
# @param obj [Object]
|
|
108
|
+
# @return [Void]
|
|
109
|
+
def self.validate_raw(obj:)
|
|
110
|
+
obj.type&.is_a?(Pinnacle::Types::ButtonClickedDataButtonType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
111
|
+
Pinnacle::Types::ButtonClickedDataButtonRaw.validate_raw(obj: obj.raw)
|
|
112
|
+
obj.payload&.is_a?(String) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.")
|
|
113
|
+
obj.metadata&.is_a?(String) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
|
114
|
+
obj.clicks.is_a?(Integer) != false || raise("Passed value for field obj.clicks is not the expected type, validation failed.")
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
|
-
require_relative "
|
|
4
|
+
require_relative "rich_button"
|
|
5
5
|
|
|
6
6
|
module Pinnacle
|
|
7
7
|
module Types
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
# Raw button data. Contains the entire button that was clicked by the user. In
|
|
9
|
+
# rare cases where we cannot determine the exact button, this will return only the
|
|
10
|
+
# button title.
|
|
11
|
+
class ButtonClickedDataButtonRaw
|
|
12
|
+
# Deserialize a JSON object to an instance of ButtonClickedDataButtonRaw
|
|
11
13
|
#
|
|
12
14
|
# @param json_object [String]
|
|
13
|
-
# @return [Pinnacle::Types::
|
|
15
|
+
# @return [Pinnacle::Types::ButtonClickedDataButtonRaw]
|
|
14
16
|
def self.from_json(json_object:)
|
|
15
17
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
16
18
|
begin
|
|
17
|
-
Pinnacle::Types::
|
|
18
|
-
return Pinnacle::Types::
|
|
19
|
+
Pinnacle::Types::RichButton.validate_raw(obj: struct)
|
|
20
|
+
return Pinnacle::Types::RichButton.from_json(json_object: struct) unless struct.nil?
|
|
19
21
|
|
|
20
22
|
return nil
|
|
21
23
|
rescue StandardError
|
|
@@ -40,7 +42,7 @@ module Pinnacle
|
|
|
40
42
|
# @return [Void]
|
|
41
43
|
def self.validate_raw(obj:)
|
|
42
44
|
begin
|
|
43
|
-
return Pinnacle::Types::
|
|
45
|
+
return Pinnacle::Types::RichButton.validate_raw(obj: obj)
|
|
44
46
|
rescue StandardError
|
|
45
47
|
# noop
|
|
46
48
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# Type of button clicked.
|
|
6
|
+
# - `CARD` for card buttons,
|
|
7
|
+
# - `QUICK_REPLY` for quick replies.
|
|
8
|
+
# - `null` if we cannot determine the button type. This is a rare edge case and is
|
|
9
|
+
# mainly here for backward compatibility.
|
|
10
|
+
class ButtonClickedDataButtonType
|
|
11
|
+
CARD = "CARD"
|
|
12
|
+
QUICK_REPLY = "QUICK_REPLY"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -8,7 +8,11 @@ module Pinnacle
|
|
|
8
8
|
module Types
|
|
9
9
|
# Information about the campaign associated with a conversation
|
|
10
10
|
class CampaignQuery
|
|
11
|
-
# @return [String] Unique identifier for the campaign
|
|
11
|
+
# @return [String] Unique identifier for the campaign. This identifier is a string that begins with
|
|
12
|
+
# the prefix:
|
|
13
|
+
# - TOLL_FREE: `tf_` (e.g., `tf_1234567890`)
|
|
14
|
+
# - 10DLC: `dlc_` (e.g., `dlc_1234567890`)
|
|
15
|
+
# - RCS: `rcs_` (e.g., `rcs_1234567890`)
|
|
12
16
|
attr_reader :id
|
|
13
17
|
# @return [Pinnacle::Types::CampaignEnum]
|
|
14
18
|
attr_reader :type
|
|
@@ -20,7 +24,11 @@ module Pinnacle
|
|
|
20
24
|
|
|
21
25
|
OMIT = Object.new
|
|
22
26
|
|
|
23
|
-
# @param id [String] Unique identifier for the campaign
|
|
27
|
+
# @param id [String] Unique identifier for the campaign. This identifier is a string that begins with
|
|
28
|
+
# the prefix:
|
|
29
|
+
# - TOLL_FREE: `tf_` (e.g., `tf_1234567890`)
|
|
30
|
+
# - 10DLC: `dlc_` (e.g., `dlc_1234567890`)
|
|
31
|
+
# - RCS: `rcs_` (e.g., `rcs_1234567890`)
|
|
24
32
|
# @param type [Pinnacle::Types::CampaignEnum]
|
|
25
33
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
34
|
# @return [Pinnacle::Types::CampaignQuery]
|
data/lib/rcs/types/contact.rb
CHANGED
|
@@ -10,7 +10,8 @@ module Pinnacle
|
|
|
10
10
|
attr_reader :description
|
|
11
11
|
# @return [String] Contact's email address, if available.
|
|
12
12
|
attr_reader :email
|
|
13
|
-
# @return [
|
|
13
|
+
# @return [String] Unique ID of the contact. This identifier is a string that always begins with
|
|
14
|
+
# the prefix `co_`, for example: `co_1234567890`.
|
|
14
15
|
attr_reader :id
|
|
15
16
|
# @return [String] Full name of the contact, if available.
|
|
16
17
|
attr_reader :name
|
|
@@ -28,7 +29,8 @@ module Pinnacle
|
|
|
28
29
|
|
|
29
30
|
# @param description [String] Additional information about the contact.
|
|
30
31
|
# @param email [String] Contact's email address, if available.
|
|
31
|
-
# @param id [
|
|
32
|
+
# @param id [String] Unique ID of the contact. This identifier is a string that always begins with
|
|
33
|
+
# the prefix `co_`, for example: `co_1234567890`.
|
|
32
34
|
# @param name [String] Full name of the contact, if available.
|
|
33
35
|
# @param phone_number [String] Contact's phone number in E.164 format.
|
|
34
36
|
# @param tags [Array<String>] List of tags associated with the contact.
|
|
@@ -95,7 +97,7 @@ module Pinnacle
|
|
|
95
97
|
def self.validate_raw(obj:)
|
|
96
98
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
|
97
99
|
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
|
98
|
-
obj.id.is_a?(
|
|
100
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
99
101
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
100
102
|
obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
|
|
101
103
|
obj.tags&.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
|
data/lib/rcs/types/contact_id.rb
CHANGED
|
@@ -6,7 +6,8 @@ require "json"
|
|
|
6
6
|
module Pinnacle
|
|
7
7
|
module Types
|
|
8
8
|
class ContactId
|
|
9
|
-
# @return [
|
|
9
|
+
# @return [String] Unique ID of the created contact. This identifier is a string that always begins
|
|
10
|
+
# with the prefix `co_`, for example: `co_1234567890`.
|
|
10
11
|
attr_reader :id
|
|
11
12
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
12
13
|
attr_reader :additional_properties
|
|
@@ -16,7 +17,8 @@ module Pinnacle
|
|
|
16
17
|
|
|
17
18
|
OMIT = Object.new
|
|
18
19
|
|
|
19
|
-
# @param id [
|
|
20
|
+
# @param id [String] Unique ID of the created contact. This identifier is a string that always begins
|
|
21
|
+
# with the prefix `co_`, for example: `co_1234567890`.
|
|
20
22
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
21
23
|
# @return [Pinnacle::Types::ContactId]
|
|
22
24
|
def initialize(id:, additional_properties: nil)
|
|
@@ -50,7 +52,7 @@ module Pinnacle
|
|
|
50
52
|
# @param obj [Object]
|
|
51
53
|
# @return [Void]
|
|
52
54
|
def self.validate_raw(obj:)
|
|
53
|
-
obj.id.is_a?(
|
|
55
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
54
56
|
end
|
|
55
57
|
end
|
|
56
58
|
end
|
|
@@ -10,15 +10,19 @@ module Pinnacle
|
|
|
10
10
|
module Types
|
|
11
11
|
# Conversation that was found.
|
|
12
12
|
class Conversation
|
|
13
|
-
# @return [
|
|
13
|
+
# @return [String] The unique identifier of the brand associated with this conversation. This
|
|
14
|
+
# identifier is a string that always begins with the prefix `b_`, for example:
|
|
15
|
+
# `b_1234567890`.
|
|
14
16
|
attr_reader :brand_id
|
|
15
|
-
# @return [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign.
|
|
17
|
+
# @return [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign. This
|
|
18
|
+
# is an object that contains the campaign ID and type.
|
|
16
19
|
attr_reader :campaign
|
|
17
20
|
# @return [Pinnacle::Types::ConversationContact] Contact information for the recipient in a conversation.
|
|
18
21
|
attr_reader :contact
|
|
19
22
|
# @return [String] ISO 8601 timestamp when the conversation was created.
|
|
20
23
|
attr_reader :created_at
|
|
21
|
-
# @return [
|
|
24
|
+
# @return [String] Unique identifier for the conversation. This identifier is a string that always
|
|
25
|
+
# begins with the prefix `conv_`, for example: `conv_1234567890`.
|
|
22
26
|
attr_reader :id
|
|
23
27
|
# @return [String] Free-form notes or comments about the conversation.
|
|
24
28
|
attr_reader :notes
|
|
@@ -37,11 +41,15 @@ module Pinnacle
|
|
|
37
41
|
|
|
38
42
|
OMIT = Object.new
|
|
39
43
|
|
|
40
|
-
# @param brand_id [
|
|
41
|
-
#
|
|
44
|
+
# @param brand_id [String] The unique identifier of the brand associated with this conversation. This
|
|
45
|
+
# identifier is a string that always begins with the prefix `b_`, for example:
|
|
46
|
+
# `b_1234567890`.
|
|
47
|
+
# @param campaign [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign. This
|
|
48
|
+
# is an object that contains the campaign ID and type.
|
|
42
49
|
# @param contact [Pinnacle::Types::ConversationContact] Contact information for the recipient in a conversation.
|
|
43
50
|
# @param created_at [String] ISO 8601 timestamp when the conversation was created.
|
|
44
|
-
# @param id [
|
|
51
|
+
# @param id [String] Unique identifier for the conversation. This identifier is a string that always
|
|
52
|
+
# begins with the prefix `conv_`, for example: `conv_1234567890`.
|
|
45
53
|
# @param notes [String] Free-form notes or comments about the conversation.
|
|
46
54
|
# @param sender [Pinnacle::Types::ConversationSender] The sender of messages in this conversation. Can be:
|
|
47
55
|
# - A phone number with its capabilities and metadata
|
|
@@ -132,11 +140,11 @@ module Pinnacle
|
|
|
132
140
|
# @param obj [Object]
|
|
133
141
|
# @return [Void]
|
|
134
142
|
def self.validate_raw(obj:)
|
|
135
|
-
obj.brand_id&.is_a?(
|
|
143
|
+
obj.brand_id&.is_a?(String) != false || raise("Passed value for field obj.brand_id is not the expected type, validation failed.")
|
|
136
144
|
obj.campaign.nil? || Pinnacle::Types::CampaignQuery.validate_raw(obj: obj.campaign)
|
|
137
145
|
Pinnacle::Types::ConversationContact.validate_raw(obj: obj.contact)
|
|
138
146
|
obj.created_at.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
|
139
|
-
obj.id.is_a?(
|
|
147
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
140
148
|
obj.notes.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
|
|
141
149
|
obj.sender.nil? || Pinnacle::Types::ConversationSender.validate_raw(obj: obj.sender)
|
|
142
150
|
obj.updated_at.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
|
@@ -7,7 +7,9 @@ module Pinnacle
|
|
|
7
7
|
module Types
|
|
8
8
|
# Retrieve conversation information by ID.
|
|
9
9
|
class ConversationByIdParams
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [String] Unique identifier of the conversation you want to retrieve. This identifier is a
|
|
11
|
+
# string that always begins with the prefix `conv_`, for example:
|
|
12
|
+
# `conv_1234567890`.
|
|
11
13
|
attr_reader :id
|
|
12
14
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
13
15
|
attr_reader :additional_properties
|
|
@@ -17,7 +19,9 @@ module Pinnacle
|
|
|
17
19
|
|
|
18
20
|
OMIT = Object.new
|
|
19
21
|
|
|
20
|
-
# @param id [
|
|
22
|
+
# @param id [String] Unique identifier of the conversation you want to retrieve. This identifier is a
|
|
23
|
+
# string that always begins with the prefix `conv_`, for example:
|
|
24
|
+
# `conv_1234567890`.
|
|
21
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
22
26
|
# @return [Pinnacle::Types::ConversationByIdParams]
|
|
23
27
|
def initialize(id:, additional_properties: nil)
|
|
@@ -51,7 +55,7 @@ module Pinnacle
|
|
|
51
55
|
# @param obj [Object]
|
|
52
56
|
# @return [Void]
|
|
53
57
|
def self.validate_raw(obj:)
|
|
54
|
-
obj.id.is_a?(
|
|
58
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
55
59
|
end
|
|
56
60
|
end
|
|
57
61
|
end
|
|
@@ -7,7 +7,8 @@ module Pinnacle
|
|
|
7
7
|
module Types
|
|
8
8
|
# Contact information for the recipient in a conversation.
|
|
9
9
|
class ConversationContact
|
|
10
|
-
# @return [
|
|
10
|
+
# @return [String] Unique ID of the contact. This identifier is a string that always begins with
|
|
11
|
+
# the prefix `co_`, for example: `co_1234567890`.
|
|
11
12
|
attr_reader :id
|
|
12
13
|
# @return [String] The contact's phone number in E.164 format.
|
|
13
14
|
attr_reader :phone_number
|
|
@@ -19,7 +20,8 @@ module Pinnacle
|
|
|
19
20
|
|
|
20
21
|
OMIT = Object.new
|
|
21
22
|
|
|
22
|
-
# @param id [
|
|
23
|
+
# @param id [String] Unique ID of the contact. This identifier is a string that always begins with
|
|
24
|
+
# the prefix `co_`, for example: `co_1234567890`.
|
|
23
25
|
# @param phone_number [String] The contact's phone number in E.164 format.
|
|
24
26
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
27
|
# @return [Pinnacle::Types::ConversationContact]
|
|
@@ -60,7 +62,7 @@ module Pinnacle
|
|
|
60
62
|
# @param obj [Object]
|
|
61
63
|
# @return [Void]
|
|
62
64
|
def self.validate_raw(obj:)
|
|
63
|
-
obj.id.is_a?(
|
|
65
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
64
66
|
obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
|
|
65
67
|
end
|
|
66
68
|
end
|