rcs 2.0.0.pre.rc.2 → 2.0.0.pre.rc.3
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 +6 -6
- data/lib/rcs/brands/types/{autofill_brand_schema_options.rb → autofill_brand_options.rb} +5 -5
- data/lib/rcs/campaigns/dlc/client.rb +12 -12
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_help.rb → upsert_dlc_campaign_help_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords.rb → upsert_dlc_campaign_keywords.rb} +20 -20
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_links.rb → upsert_dlc_campaign_links.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_in.rb → upsert_dlc_campaign_opt_in_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_out.rb → upsert_dlc_campaign_opt_out_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_options.rb → upsert_dlc_campaign_options.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_use_case.rb → upsert_dlc_campaign_use_case.rb} +5 -5
- data/lib/rcs/campaigns/rcs/client.rb +25 -25
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_emails_item.rb → rcs_agent_email.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_phones_item.rb → rcs_agent_phone.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_websites_item.rb → rcs_agent_website.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent.rb → upsert_rcs_agent.rb} +17 -17
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_links.rb → upsert_rcs_links.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_in.rb → upsert_rcs_opt_in.rb} +13 -13
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_out.rb → upsert_rcs_opt_out.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_use_case.rb → upsert_rcs_use_case.rb} +5 -5
- data/lib/rcs/campaigns/toll_free/client.rb +4 -4
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +10 -10
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_opt_in.rb +8 -8
- data/lib/rcs/conversations/client.rb +2 -2
- data/lib/rcs/messages/client.rb +24 -10
- data/lib/rcs/messages/mms/client.rb +118 -0
- data/lib/rcs/messages/{send/types/send_mms_response.rb → mms/types/mms_send_response.rb} +4 -4
- data/lib/rcs/messages/{send/types/send_mms_schema_options.rb → mms/types/send_mms_options.rb} +6 -6
- data/lib/rcs/messages/rcs/client.rb +68 -0
- data/lib/rcs/messages/{send/types/send_rcs_response.rb → rcs/types/rcs_send_response.rb} +4 -4
- data/lib/rcs/messages/sms/client.rb +198 -0
- data/lib/rcs/messages/{send/types/send_sms_schema_options.rb → sms/types/send_sms_options.rb} +6 -6
- data/lib/rcs/messages/{send/types/send_sms_response.rb → sms/types/sms_send_response.rb} +4 -4
- data/lib/rcs/messages/types/{message_reaction_schema_options.rb → react_message_options.rb} +5 -5
- data/lib/rcs/phone_numbers/client.rb +18 -18
- data/lib/rcs/phone_numbers/types/{phone_details_schema_options_enhanced_contact_info.rb → enhanced_contact_info.rb} +5 -7
- data/lib/rcs/phone_numbers/types/{phone_details_schema_options.rb → retrieve_phone_number_details_options.rb} +10 -10
- data/lib/rcs/phone_numbers/types/{search_schema_number.rb → search_phone_number_by_digits.rb} +5 -5
- data/lib/rcs/phone_numbers/types/{search_schema_location.rb → search_phone_number_by_location.rb} +5 -5
- data/lib/rcs/phone_numbers/types/{search_schema_options.rb → search_phone_number_options.rb} +5 -5
- data/lib/rcs/phone_numbers/webhook/client.rb +2 -2
- data/lib/rcs/tools/file/client.rb +3 -3
- data/lib/rcs/tools/file/types/{file_upload_schema_options_download.rb → download_options.rb} +5 -5
- data/lib/rcs/tools/file/types/{file_upload_schema_options.rb → upload_file_options.rb} +10 -10
- data/lib/rcs/types/{attach_webhook_schema_webhook_id.rb → attach_webhook_by_id_params.rb} +5 -5
- data/lib/rcs/types/attach_webhook_params.rb +8 -8
- data/lib/rcs/types/{get_conversation_request_id.rb → conversation_by_id_params.rb} +5 -5
- data/lib/rcs/types/{get_conversation_request_recipient.rb → conversation_by_participants_params.rb} +5 -5
- data/lib/rcs/types/{attach_webhook_schema_name.rb → create_and_attach_webhook_by_url_params.rb} +5 -5
- data/lib/rcs/types/get_conversation_params.rb +8 -8
- data/lib/rcs/types/link_click_event.rb +8 -8
- data/lib/rcs/types/message.rb +8 -8
- data/lib/rcs/types/rcs.rb +12 -12
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +8 -8
- data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +8 -8
- data/lib/rcs/types/rcs_cards.rb +4 -4
- data/lib/rcs/types/rcs_cards_cards_item.rb +4 -4
- data/lib/rcs/types/rcs_cards_content.rb +4 -4
- data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -4
- data/lib/rcs/types/rcs_media_content.rb +4 -4
- data/lib/rcs/types/rcs_text_content.rb +4 -4
- data/lib/rcs/types/{rcs_button_content.rb → rich_button.rb} +10 -10
- data/lib/rcs/types/{rcs_card.rb → rich_cards_message.rb} +9 -9
- data/lib/rcs/types/{rcs_media.rb → rich_media_message.rb} +9 -9
- data/lib/rcs/types/{rcs_text.rb → rich_text_message.rb} +9 -9
- data/lib/rcs/types/toll_free_campaign.rb +10 -10
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +10 -10
- data/lib/rcs/types/{nullable_contact.rb → upsert_contact.rb} +5 -5
- data/lib/rcs/types/{toll_free_campaign_schema_opt_in.rb → upsert_toll_free_campaign_opt_in.rb} +13 -13
- data/lib/rcs/types/{toll_free_campaign_schema_use_case.rb → upsert_toll_free_campaign_use_case.rb} +5 -5
- data/lib/rcs.rb +0 -7
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +40 -40
- metadata +43 -45
- data/lib/rcs/message/client.rb +0 -30
- data/lib/rcs/message/sms/client.rb +0 -96
- data/lib/rcs/messages/send/client.rb +0 -318
@@ -6,7 +6,7 @@ require "json"
|
|
6
6
|
module Pinnacle
|
7
7
|
module Types
|
8
8
|
# Retrieve conversation information by ID.
|
9
|
-
class
|
9
|
+
class ConversationByIdParams
|
10
10
|
# @return [Integer] Unique identifier of the conversation you want to retrieve.
|
11
11
|
attr_reader :id
|
12
12
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -19,17 +19,17 @@ module Pinnacle
|
|
19
19
|
|
20
20
|
# @param id [Integer] Unique identifier of the conversation you want to retrieve.
|
21
21
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
-
# @return [Pinnacle::Types::
|
22
|
+
# @return [Pinnacle::Types::ConversationByIdParams]
|
23
23
|
def initialize(id:, additional_properties: nil)
|
24
24
|
@id = id
|
25
25
|
@additional_properties = additional_properties
|
26
26
|
@_field_set = { "id": id }
|
27
27
|
end
|
28
28
|
|
29
|
-
# Deserialize a JSON object to an instance of
|
29
|
+
# Deserialize a JSON object to an instance of ConversationByIdParams
|
30
30
|
#
|
31
31
|
# @param json_object [String]
|
32
|
-
# @return [Pinnacle::Types::
|
32
|
+
# @return [Pinnacle::Types::ConversationByIdParams]
|
33
33
|
def self.from_json(json_object:)
|
34
34
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
35
|
parsed_json = JSON.parse(json_object)
|
@@ -37,7 +37,7 @@ module Pinnacle
|
|
37
37
|
new(id: id, additional_properties: struct)
|
38
38
|
end
|
39
39
|
|
40
|
-
# Serialize an instance of
|
40
|
+
# Serialize an instance of ConversationByIdParams to a JSON object
|
41
41
|
#
|
42
42
|
# @return [String]
|
43
43
|
def to_json(*_args)
|
data/lib/rcs/types/{get_conversation_request_recipient.rb → conversation_by_participants_params.rb}
RENAMED
@@ -6,7 +6,7 @@ require "json"
|
|
6
6
|
module Pinnacle
|
7
7
|
module Types
|
8
8
|
# Retrieve conversation information by sender and recipient.
|
9
|
-
class
|
9
|
+
class ConversationByParticipantsParams
|
10
10
|
# @return [String] The recipient's phone number in E.164 format
|
11
11
|
attr_reader :recipient
|
12
12
|
# @return [String] The sender identifier. Can be either:
|
@@ -26,7 +26,7 @@ module Pinnacle
|
|
26
26
|
# - A phone number in E.164 format
|
27
27
|
# - An RCS agent ID prefixed with 'agent_'
|
28
28
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
-
# @return [Pinnacle::Types::
|
29
|
+
# @return [Pinnacle::Types::ConversationByParticipantsParams]
|
30
30
|
def initialize(recipient:, sender:, additional_properties: nil)
|
31
31
|
@recipient = recipient
|
32
32
|
@sender = sender
|
@@ -34,10 +34,10 @@ module Pinnacle
|
|
34
34
|
@_field_set = { "recipient": recipient, "sender": sender }
|
35
35
|
end
|
36
36
|
|
37
|
-
# Deserialize a JSON object to an instance of
|
37
|
+
# Deserialize a JSON object to an instance of ConversationByParticipantsParams
|
38
38
|
#
|
39
39
|
# @param json_object [String]
|
40
|
-
# @return [Pinnacle::Types::
|
40
|
+
# @return [Pinnacle::Types::ConversationByParticipantsParams]
|
41
41
|
def self.from_json(json_object:)
|
42
42
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
43
|
parsed_json = JSON.parse(json_object)
|
@@ -50,7 +50,7 @@ module Pinnacle
|
|
50
50
|
)
|
51
51
|
end
|
52
52
|
|
53
|
-
# Serialize an instance of
|
53
|
+
# Serialize an instance of ConversationByParticipantsParams to a JSON object
|
54
54
|
#
|
55
55
|
# @return [String]
|
56
56
|
def to_json(*_args)
|
data/lib/rcs/types/{attach_webhook_schema_name.rb → create_and_attach_webhook_by_url_params.rb}
RENAMED
@@ -7,7 +7,7 @@ require "json"
|
|
7
7
|
module Pinnacle
|
8
8
|
module Types
|
9
9
|
# Create a new webhook and immediately attach it to your phone number.
|
10
|
-
class
|
10
|
+
class CreateAndAttachWebhookByUrlParams
|
11
11
|
# @return [String] Name of your new webhook.
|
12
12
|
attr_reader :name
|
13
13
|
# @return [String] HTTPS endpoint where your webhook events will be sent as HTTP POST requests.
|
@@ -36,7 +36,7 @@ module Pinnacle
|
|
36
36
|
# Set to null if you want to listen to all event types for this phone number. <br>
|
37
37
|
# Defaults to null.
|
38
38
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
-
# @return [Pinnacle::Types::
|
39
|
+
# @return [Pinnacle::Types::CreateAndAttachWebhookByUrlParams]
|
40
40
|
def initialize(name:, url:, event: OMIT, additional_properties: nil)
|
41
41
|
@name = name
|
42
42
|
@url = url
|
@@ -47,10 +47,10 @@ module Pinnacle
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
# Deserialize a JSON object to an instance of
|
50
|
+
# Deserialize a JSON object to an instance of CreateAndAttachWebhookByUrlParams
|
51
51
|
#
|
52
52
|
# @param json_object [String]
|
53
|
-
# @return [Pinnacle::Types::
|
53
|
+
# @return [Pinnacle::Types::CreateAndAttachWebhookByUrlParams]
|
54
54
|
def self.from_json(json_object:)
|
55
55
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
56
56
|
parsed_json = JSON.parse(json_object)
|
@@ -65,7 +65,7 @@ module Pinnacle
|
|
65
65
|
)
|
66
66
|
end
|
67
67
|
|
68
|
-
# Serialize an instance of
|
68
|
+
# Serialize an instance of CreateAndAttachWebhookByUrlParams to a JSON object
|
69
69
|
#
|
70
70
|
# @return [String]
|
71
71
|
def to_json(*_args)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
4
|
+
require_relative "conversation_by_id_params"
|
5
|
+
require_relative "conversation_by_participants_params"
|
6
6
|
|
7
7
|
module Pinnacle
|
8
8
|
module Types
|
@@ -15,16 +15,16 @@ module Pinnacle
|
|
15
15
|
def self.from_json(json_object:)
|
16
16
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
17
|
begin
|
18
|
-
Pinnacle::Types::
|
19
|
-
return Pinnacle::Types::
|
18
|
+
Pinnacle::Types::ConversationByIdParams.validate_raw(obj: struct)
|
19
|
+
return Pinnacle::Types::ConversationByIdParams.from_json(json_object: struct) unless struct.nil?
|
20
20
|
|
21
21
|
return nil
|
22
22
|
rescue StandardError
|
23
23
|
# noop
|
24
24
|
end
|
25
25
|
begin
|
26
|
-
Pinnacle::Types::
|
27
|
-
return Pinnacle::Types::
|
26
|
+
Pinnacle::Types::ConversationByParticipantsParams.validate_raw(obj: struct)
|
27
|
+
return Pinnacle::Types::ConversationByParticipantsParams.from_json(json_object: struct) unless struct.nil?
|
28
28
|
|
29
29
|
return nil
|
30
30
|
rescue StandardError
|
@@ -41,12 +41,12 @@ module Pinnacle
|
|
41
41
|
# @return [Void]
|
42
42
|
def self.validate_raw(obj:)
|
43
43
|
begin
|
44
|
-
return Pinnacle::Types::
|
44
|
+
return Pinnacle::Types::ConversationByIdParams.validate_raw(obj: obj)
|
45
45
|
rescue StandardError
|
46
46
|
# noop
|
47
47
|
end
|
48
48
|
begin
|
49
|
-
return Pinnacle::Types::
|
49
|
+
return Pinnacle::Types::ConversationByParticipantsParams.validate_raw(obj: obj)
|
50
50
|
rescue StandardError
|
51
51
|
# noop
|
52
52
|
end
|
@@ -59,7 +59,7 @@ module Pinnacle
|
|
59
59
|
# @return [Hash{String => Object}] Additional metadata as JSON object.
|
60
60
|
attr_reader :metadata
|
61
61
|
# @return [String] HTTP method used.
|
62
|
-
attr_reader :
|
62
|
+
attr_reader :method_
|
63
63
|
# @return [Integer] Metro area code.
|
64
64
|
attr_reader :metro_code
|
65
65
|
# @return [Float] Network downlink speed estimate in Mbps.
|
@@ -142,7 +142,7 @@ module Pinnacle
|
|
142
142
|
# @param link_id [Integer] ID of your shortened URL.
|
143
143
|
# @param longitude [Float] Geographic longitude.
|
144
144
|
# @param metadata [Hash{String => Object}] Additional metadata as JSON object.
|
145
|
-
# @param
|
145
|
+
# @param method_ [String] HTTP method used.
|
146
146
|
# @param metro_code [Integer] Metro area code.
|
147
147
|
# @param network_downlink [Float] Network downlink speed estimate in Mbps.
|
148
148
|
# @param network_rtt [Integer] Network round-trip time in milliseconds.
|
@@ -170,7 +170,7 @@ module Pinnacle
|
|
170
170
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
171
171
|
# @return [Pinnacle::Types::LinkClickEvent]
|
172
172
|
def initialize(created_at:, id:, link_id:, accept_language: OMIT, accuracy_radius_km: OMIT, asn: OMIT, blocked_reason: OMIT,
|
173
|
-
ch_ua_brand: OMIT, ch_ua_mobile: OMIT, ch_ua_platform: OMIT, city: OMIT, color_depth: OMIT, connection_type: OMIT, country: OMIT, error_details: OMIT, fbclid: OMIT, final_url: OMIT, fingerprint_id: OMIT, gclid: OMIT, ip_address: OMIT, ip_chain: OMIT, is_bot: OMIT, latency_ms: OMIT, latitude: OMIT, longitude: OMIT, metadata: OMIT,
|
173
|
+
ch_ua_brand: OMIT, ch_ua_mobile: OMIT, ch_ua_platform: OMIT, city: OMIT, color_depth: OMIT, connection_type: OMIT, country: OMIT, error_details: OMIT, fbclid: OMIT, final_url: OMIT, fingerprint_id: OMIT, gclid: OMIT, ip_address: OMIT, ip_chain: OMIT, is_bot: OMIT, latency_ms: OMIT, latitude: OMIT, longitude: OMIT, metadata: OMIT, method_: OMIT, metro_code: OMIT, network_downlink: OMIT, network_rtt: OMIT, performance_ttfb_ms: OMIT, postal_code: OMIT, redirect_hops: OMIT, referrer: OMIT, referrer_domain: OMIT, region: OMIT, resolved_at: OMIT, screen_res: OMIT, status_code: OMIT, timezone_offset_min: OMIT, tor_exit_node: OMIT, ua_browser: OMIT, ua_device: OMIT, ua_os: OMIT, ua_version: OMIT, user_agent: OMIT, utm_campaign: OMIT, utm_content: OMIT, utm_medium: OMIT, utm_source: OMIT, utm_term: OMIT, additional_properties: nil)
|
174
174
|
@accept_language = accept_language if accept_language != OMIT
|
175
175
|
@accuracy_radius_km = accuracy_radius_km if accuracy_radius_km != OMIT
|
176
176
|
@asn = asn if asn != OMIT
|
@@ -197,7 +197,7 @@ module Pinnacle
|
|
197
197
|
@link_id = link_id
|
198
198
|
@longitude = longitude if longitude != OMIT
|
199
199
|
@metadata = metadata if metadata != OMIT
|
200
|
-
@
|
200
|
+
@method_ = method_ if method_ != OMIT
|
201
201
|
@metro_code = metro_code if metro_code != OMIT
|
202
202
|
@network_downlink = network_downlink if network_downlink != OMIT
|
203
203
|
@network_rtt = network_rtt if network_rtt != OMIT
|
@@ -250,7 +250,7 @@ module Pinnacle
|
|
250
250
|
"link_id": link_id,
|
251
251
|
"longitude": longitude,
|
252
252
|
"metadata": metadata,
|
253
|
-
"method":
|
253
|
+
"method": method_,
|
254
254
|
"metro_code": metro_code,
|
255
255
|
"network_downlink": network_downlink,
|
256
256
|
"network_rtt": network_rtt,
|
@@ -313,7 +313,7 @@ module Pinnacle
|
|
313
313
|
link_id = parsed_json["link_id"]
|
314
314
|
longitude = parsed_json["longitude"]
|
315
315
|
metadata = parsed_json["metadata"]
|
316
|
-
|
316
|
+
method_ = parsed_json["method"]
|
317
317
|
metro_code = parsed_json["metro_code"]
|
318
318
|
network_downlink = parsed_json["network_downlink"]
|
319
319
|
network_rtt = parsed_json["network_rtt"]
|
@@ -365,7 +365,7 @@ module Pinnacle
|
|
365
365
|
link_id: link_id,
|
366
366
|
longitude: longitude,
|
367
367
|
metadata: metadata,
|
368
|
-
|
368
|
+
method_: method_,
|
369
369
|
metro_code: metro_code,
|
370
370
|
network_downlink: network_downlink,
|
371
371
|
network_rtt: network_rtt,
|
@@ -434,7 +434,7 @@ module Pinnacle
|
|
434
434
|
obj.link_id.is_a?(Integer) != false || raise("Passed value for field obj.link_id is not the expected type, validation failed.")
|
435
435
|
obj.longitude&.is_a?(Float) != false || raise("Passed value for field obj.longitude is not the expected type, validation failed.")
|
436
436
|
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
437
|
-
obj.
|
437
|
+
obj.method_&.is_a?(String) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
438
438
|
obj.metro_code&.is_a?(Integer) != false || raise("Passed value for field obj.metro_code is not the expected type, validation failed.")
|
439
439
|
obj.network_downlink&.is_a?(Float) != false || raise("Passed value for field obj.network_downlink is not the expected type, validation failed.")
|
440
440
|
obj.network_rtt&.is_a?(Integer) != false || raise("Passed value for field obj.network_rtt is not the expected type, validation failed.")
|
data/lib/rcs/types/message.rb
CHANGED
@@ -26,7 +26,7 @@ module Pinnacle
|
|
26
26
|
# @return [Integer] Unique identifier of the message.
|
27
27
|
attr_reader :id
|
28
28
|
# @return [Pinnacle::Types::MessageMethodEnum]
|
29
|
-
attr_reader :
|
29
|
+
attr_reader :method_
|
30
30
|
# @return [Integer] Number of segments the message was split into for delivery.
|
31
31
|
attr_reader :num_segments
|
32
32
|
# @return [String] Phone number that received the message in E.164 format.
|
@@ -58,7 +58,7 @@ module Pinnacle
|
|
58
58
|
# <br>
|
59
59
|
# Null indicates no errors.
|
60
60
|
# @param id [Integer] Unique identifier of the message.
|
61
|
-
# @param
|
61
|
+
# @param method_ [Pinnacle::Types::MessageMethodEnum]
|
62
62
|
# @param num_segments [Integer] Number of segments the message was split into for delivery.
|
63
63
|
# @param receiver [String] Phone number that received the message in E.164 format.
|
64
64
|
# @param sender [String] Phone number or agent that sent the message.
|
@@ -68,14 +68,14 @@ module Pinnacle
|
|
68
68
|
# @param type [Pinnacle::Types::MessageProtocolEnum]
|
69
69
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
70
70
|
# @return [Pinnacle::Types::Message]
|
71
|
-
def initialize(content:, id:,
|
71
|
+
def initialize(content:, id:, method_:, num_segments:, receiver:, sender:, status:, type:, cost: OMIT,
|
72
72
|
delivered_at: OMIT, error: OMIT, sent_at: OMIT, additional_properties: nil)
|
73
73
|
@content = content
|
74
74
|
@cost = cost if cost != OMIT
|
75
75
|
@delivered_at = delivered_at if delivered_at != OMIT
|
76
76
|
@error = error if error != OMIT
|
77
77
|
@id = id
|
78
|
-
@
|
78
|
+
@method_ = method_
|
79
79
|
@num_segments = num_segments
|
80
80
|
@receiver = receiver
|
81
81
|
@sender = sender
|
@@ -89,7 +89,7 @@ module Pinnacle
|
|
89
89
|
"deliveredAt": delivered_at,
|
90
90
|
"error": error,
|
91
91
|
"id": id,
|
92
|
-
"method":
|
92
|
+
"method": method_,
|
93
93
|
"numSegments": num_segments,
|
94
94
|
"receiver": receiver,
|
95
95
|
"sender": sender,
|
@@ -118,7 +118,7 @@ module Pinnacle
|
|
118
118
|
delivered_at = parsed_json["deliveredAt"]
|
119
119
|
error = parsed_json["error"]
|
120
120
|
id = parsed_json["id"]
|
121
|
-
|
121
|
+
method_ = parsed_json["method"]
|
122
122
|
num_segments = parsed_json["numSegments"]
|
123
123
|
receiver = parsed_json["receiver"]
|
124
124
|
sender = parsed_json["sender"]
|
@@ -131,7 +131,7 @@ module Pinnacle
|
|
131
131
|
delivered_at: delivered_at,
|
132
132
|
error: error,
|
133
133
|
id: id,
|
134
|
-
|
134
|
+
method_: method_,
|
135
135
|
num_segments: num_segments,
|
136
136
|
receiver: receiver,
|
137
137
|
sender: sender,
|
@@ -161,7 +161,7 @@ module Pinnacle
|
|
161
161
|
obj.delivered_at&.is_a?(String) != false || raise("Passed value for field obj.delivered_at is not the expected type, validation failed.")
|
162
162
|
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
163
163
|
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
164
|
-
obj.
|
164
|
+
obj.method_.is_a?(Pinnacle::Types::MessageMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
165
165
|
obj.num_segments.is_a?(Integer) != false || raise("Passed value for field obj.num_segments is not the expected type, validation failed.")
|
166
166
|
obj.receiver.is_a?(String) != false || raise("Passed value for field obj.receiver is not the expected type, validation failed.")
|
167
167
|
obj.sender.is_a?(String) != false || raise("Passed value for field obj.sender is not the expected type, validation failed.")
|
data/lib/rcs/types/rcs.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
4
|
+
require_relative "rich_text_message"
|
5
|
+
require_relative "rich_media_message"
|
6
|
+
require_relative "rich_cards_message"
|
7
7
|
|
8
8
|
module Pinnacle
|
9
9
|
module Types
|
@@ -15,24 +15,24 @@ module Pinnacle
|
|
15
15
|
def self.from_json(json_object:)
|
16
16
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
17
|
begin
|
18
|
-
Pinnacle::Types::
|
19
|
-
return Pinnacle::Types::
|
18
|
+
Pinnacle::Types::RichTextMessage.validate_raw(obj: struct)
|
19
|
+
return Pinnacle::Types::RichTextMessage.from_json(json_object: struct) unless struct.nil?
|
20
20
|
|
21
21
|
return nil
|
22
22
|
rescue StandardError
|
23
23
|
# noop
|
24
24
|
end
|
25
25
|
begin
|
26
|
-
Pinnacle::Types::
|
27
|
-
return Pinnacle::Types::
|
26
|
+
Pinnacle::Types::RichMediaMessage.validate_raw(obj: struct)
|
27
|
+
return Pinnacle::Types::RichMediaMessage.from_json(json_object: struct) unless struct.nil?
|
28
28
|
|
29
29
|
return nil
|
30
30
|
rescue StandardError
|
31
31
|
# noop
|
32
32
|
end
|
33
33
|
begin
|
34
|
-
Pinnacle::Types::
|
35
|
-
return Pinnacle::Types::
|
34
|
+
Pinnacle::Types::RichCardsMessage.validate_raw(obj: struct)
|
35
|
+
return Pinnacle::Types::RichCardsMessage.from_json(json_object: struct) unless struct.nil?
|
36
36
|
|
37
37
|
return nil
|
38
38
|
rescue StandardError
|
@@ -49,17 +49,17 @@ module Pinnacle
|
|
49
49
|
# @return [Void]
|
50
50
|
def self.validate_raw(obj:)
|
51
51
|
begin
|
52
|
-
return Pinnacle::Types::
|
52
|
+
return Pinnacle::Types::RichTextMessage.validate_raw(obj: obj)
|
53
53
|
rescue StandardError
|
54
54
|
# noop
|
55
55
|
end
|
56
56
|
begin
|
57
|
-
return Pinnacle::Types::
|
57
|
+
return Pinnacle::Types::RichMediaMessage.validate_raw(obj: obj)
|
58
58
|
rescue StandardError
|
59
59
|
# noop
|
60
60
|
end
|
61
61
|
begin
|
62
|
-
return Pinnacle::Types::
|
62
|
+
return Pinnacle::Types::RichCardsMessage.validate_raw(obj: obj)
|
63
63
|
rescue StandardError
|
64
64
|
# noop
|
65
65
|
end
|
@@ -9,7 +9,7 @@ module Pinnacle
|
|
9
9
|
# Opt-in configuration.
|
10
10
|
class RcsCampaignSchemaExtraOptIn
|
11
11
|
# @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
12
|
-
attr_reader :
|
12
|
+
attr_reader :method_
|
13
13
|
# @return [String] Message shown to users explaining what they are agreeing to when opting in.
|
14
14
|
attr_reader :terms_and_conditions
|
15
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -20,15 +20,15 @@ module Pinnacle
|
|
20
20
|
|
21
21
|
OMIT = Object.new
|
22
22
|
|
23
|
-
# @param
|
23
|
+
# @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
24
24
|
# @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
26
|
# @return [Pinnacle::Types::RcsCampaignSchemaExtraOptIn]
|
27
|
-
def initialize(
|
28
|
-
@
|
27
|
+
def initialize(method_: OMIT, terms_and_conditions: OMIT, additional_properties: nil)
|
28
|
+
@method_ = method_ if method_ != OMIT
|
29
29
|
@terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
|
30
30
|
@additional_properties = additional_properties
|
31
|
-
@_field_set = { "method":
|
31
|
+
@_field_set = { "method": method_, "termsAndConditions": terms_and_conditions }.reject do |_k, v|
|
32
32
|
v == OMIT
|
33
33
|
end
|
34
34
|
end
|
@@ -40,10 +40,10 @@ module Pinnacle
|
|
40
40
|
def self.from_json(json_object:)
|
41
41
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
42
|
parsed_json = JSON.parse(json_object)
|
43
|
-
|
43
|
+
method_ = parsed_json["method"]
|
44
44
|
terms_and_conditions = parsed_json["termsAndConditions"]
|
45
45
|
new(
|
46
|
-
|
46
|
+
method_: method_,
|
47
47
|
terms_and_conditions: terms_and_conditions,
|
48
48
|
additional_properties: struct
|
49
49
|
)
|
@@ -63,7 +63,7 @@ module Pinnacle
|
|
63
63
|
# @param obj [Object]
|
64
64
|
# @return [Void]
|
65
65
|
def self.validate_raw(obj:)
|
66
|
-
obj.
|
66
|
+
obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
67
67
|
obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
|
68
68
|
end
|
69
69
|
end
|
@@ -11,7 +11,7 @@ module Pinnacle
|
|
11
11
|
# @return [String] Message shown to users explaining what they are agreeing to when opting in.
|
12
12
|
attr_reader :terms_and_conditions
|
13
13
|
# @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
14
|
-
attr_reader :
|
14
|
+
attr_reader :method_
|
15
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
16
16
|
attr_reader :additional_properties
|
17
17
|
# @return [Object]
|
@@ -21,14 +21,14 @@ module Pinnacle
|
|
21
21
|
OMIT = Object.new
|
22
22
|
|
23
23
|
# @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
|
24
|
-
# @param
|
24
|
+
# @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
26
|
# @return [Pinnacle::Types::RcsCampaignSchemaOptIn]
|
27
|
-
def initialize(terms_and_conditions: OMIT,
|
27
|
+
def initialize(terms_and_conditions: OMIT, method_: OMIT, additional_properties: nil)
|
28
28
|
@terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
|
29
|
-
@
|
29
|
+
@method_ = method_ if method_ != OMIT
|
30
30
|
@additional_properties = additional_properties
|
31
|
-
@_field_set = { "termsAndConditions": terms_and_conditions, "method":
|
31
|
+
@_field_set = { "termsAndConditions": terms_and_conditions, "method": method_ }.reject do |_k, v|
|
32
32
|
v == OMIT
|
33
33
|
end
|
34
34
|
end
|
@@ -41,10 +41,10 @@ module Pinnacle
|
|
41
41
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
42
|
parsed_json = JSON.parse(json_object)
|
43
43
|
terms_and_conditions = parsed_json["termsAndConditions"]
|
44
|
-
|
44
|
+
method_ = parsed_json["method"]
|
45
45
|
new(
|
46
46
|
terms_and_conditions: terms_and_conditions,
|
47
|
-
|
47
|
+
method_: method_,
|
48
48
|
additional_properties: struct
|
49
49
|
)
|
50
50
|
end
|
@@ -64,7 +64,7 @@ module Pinnacle
|
|
64
64
|
# @return [Void]
|
65
65
|
def self.validate_raw(obj:)
|
66
66
|
obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
|
67
|
-
obj.
|
67
|
+
obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
data/lib/rcs/types/rcs_cards.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_cards_cards_item"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsCards
|
15
15
|
# @return [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
16
16
|
attr_reader :cards
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param cards [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsCards]
|
31
31
|
def initialize(cards:, quick_replies:, additional_properties: nil)
|
@@ -48,7 +48,7 @@ module Pinnacle
|
|
48
48
|
end
|
49
49
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
50
50
|
item = item.to_json
|
51
|
-
Pinnacle::Types::
|
51
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
52
52
|
end
|
53
53
|
new(
|
54
54
|
cards: cards,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require "ostruct"
|
5
5
|
require "json"
|
6
6
|
|
@@ -8,7 +8,7 @@ module Pinnacle
|
|
8
8
|
module Types
|
9
9
|
# Individual card containing title, optional media, and action buttons.
|
10
10
|
class RcsCardsCardsItem
|
11
|
-
# @return [Array<Pinnacle::Types::
|
11
|
+
# @return [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
12
12
|
attr_reader :buttons
|
13
13
|
# @return [String] Media file URLs to send.
|
14
14
|
attr_reader :media
|
@@ -24,7 +24,7 @@ module Pinnacle
|
|
24
24
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
|
-
# @param buttons [Array<Pinnacle::Types::
|
27
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
28
28
|
# @param media [String] Media file URLs to send.
|
29
29
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
30
30
|
# @param title [String] Title displayed on the card.
|
@@ -50,7 +50,7 @@ module Pinnacle
|
|
50
50
|
parsed_json = JSON.parse(json_object)
|
51
51
|
buttons = parsed_json["buttons"]&.map do |item|
|
52
52
|
item = item.to_json
|
53
|
-
Pinnacle::Types::
|
53
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
54
54
|
end
|
55
55
|
media = parsed_json["media"]
|
56
56
|
subtitle = parsed_json["subtitle"]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_cards_content_cards_item"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsCardsContent
|
15
15
|
# @return [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
16
16
|
attr_reader :cards
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param cards [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsCardsContent]
|
31
31
|
def initialize(cards:, quick_replies:, additional_properties: nil)
|
@@ -48,7 +48,7 @@ module Pinnacle
|
|
48
48
|
end
|
49
49
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
50
50
|
item = item.to_json
|
51
|
-
Pinnacle::Types::
|
51
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
52
52
|
end
|
53
53
|
new(
|
54
54
|
cards: cards,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require_relative "rcs_media_details_content"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
@@ -9,7 +9,7 @@ module Pinnacle
|
|
9
9
|
module Types
|
10
10
|
# Individual card containing title, optional media, and action buttons.
|
11
11
|
class RcsCardsContentCardsItem
|
12
|
-
# @return [Array<Pinnacle::Types::
|
12
|
+
# @return [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
13
13
|
attr_reader :buttons
|
14
14
|
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
15
15
|
attr_reader :media
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
|
26
26
|
OMIT = Object.new
|
27
27
|
|
28
|
-
# @param buttons [Array<Pinnacle::Types::
|
28
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
29
29
|
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
30
30
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
31
31
|
# @param title [String] Title displayed on the card.
|
@@ -51,7 +51,7 @@ module Pinnacle
|
|
51
51
|
parsed_json = JSON.parse(json_object)
|
52
52
|
buttons = parsed_json["buttons"]&.map do |item|
|
53
53
|
item = item.to_json
|
54
|
-
Pinnacle::Types::
|
54
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
55
55
|
end
|
56
56
|
if parsed_json["media"].nil?
|
57
57
|
media = nil
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_media_details_content"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsMediaContent
|
15
15
|
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
16
16
|
attr_reader :media
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsMediaContent]
|
31
31
|
def initialize(media:, quick_replies:, additional_properties: nil)
|
@@ -50,7 +50,7 @@ module Pinnacle
|
|
50
50
|
end
|
51
51
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
52
52
|
item = item.to_json
|
53
|
-
Pinnacle::Types::
|
53
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
54
54
|
end
|
55
55
|
new(
|
56
56
|
media: media,
|