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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +36 -24
  3. data/lib/rcs/campaigns/dlc/client.rb +36 -26
  4. data/lib/rcs/campaigns/rcs/client.rb +26 -22
  5. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +6 -6
  6. data/lib/rcs/campaigns/toll_free/client.rb +32 -26
  7. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +6 -6
  8. data/lib/rcs/contacts/client.rb +10 -8
  9. data/lib/rcs/conversations/client.rb +144 -16
  10. data/lib/rcs/conversations/types/conversations_list_messages_request_direction.rb +12 -0
  11. data/lib/rcs/conversations/types/conversations_list_messages_request_sort_order.rb +12 -0
  12. data/lib/rcs/conversations/types/conversations_list_messages_request_status.rb +17 -0
  13. data/lib/rcs/conversations/types/conversations_list_messages_request_type.rb +13 -0
  14. data/lib/rcs/messages/client.rb +12 -29
  15. data/lib/rcs/messages/rcs/client.rb +125 -1
  16. data/lib/rcs/messages/rcs/types/send_typing_indicator_schema_options.rb +66 -0
  17. data/lib/rcs/phone_numbers/campaign/client.rb +20 -6
  18. data/lib/rcs/phone_numbers/client.rb +0 -14
  19. data/lib/rcs/phone_numbers/webhook/client.rb +12 -10
  20. data/lib/rcs/rcs/client.rb +32 -18
  21. data/lib/rcs/status/get/client.rb +32 -16
  22. data/lib/rcs/tools/contact_card/client.rb +18 -8
  23. data/lib/rcs/tools/file/client.rb +92 -2
  24. data/lib/rcs/tools/file/types/upload_file_options.rb +21 -3
  25. data/lib/rcs/tools/url/client.rb +4 -2
  26. data/lib/rcs/types/attach_webhook_by_id_params.rb +5 -5
  27. data/lib/rcs/types/attach_webhook_response_webhook.rb +5 -3
  28. data/lib/rcs/types/autofill_campaign_params.rb +15 -3
  29. data/lib/rcs/types/autofill_dlc_campaign_response.rb +10 -6
  30. data/lib/rcs/types/autofill_dlc_response_keywords.rb +8 -10
  31. data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +3 -3
  32. data/lib/rcs/types/autofill_dlc_response_keywords_opt_in.rb +6 -4
  33. data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +3 -3
  34. data/lib/rcs/types/autofill_dlc_response_options.rb +12 -12
  35. data/lib/rcs/types/brand_status.rb +5 -3
  36. data/lib/rcs/types/{inbound_button.rb → button_clicked.rb} +7 -7
  37. data/lib/rcs/types/button_clicked_data.rb +80 -0
  38. data/lib/rcs/types/button_clicked_data_button.rb +118 -0
  39. data/lib/rcs/types/{click_action_data.rb → button_clicked_data_button_raw.rb} +10 -8
  40. data/lib/rcs/types/button_clicked_data_button_type.rb +15 -0
  41. data/lib/rcs/types/campaign_query.rb +10 -2
  42. data/lib/rcs/types/contact.rb +5 -3
  43. data/lib/rcs/types/contact_id.rb +5 -3
  44. data/lib/rcs/types/conversation.rb +16 -8
  45. data/lib/rcs/types/conversation_by_id_params.rb +7 -3
  46. data/lib/rcs/types/conversation_contact.rb +5 -3
  47. data/lib/rcs/types/conversation_list.rb +50 -28
  48. data/lib/rcs/types/create_url_options.rb +4 -2
  49. data/lib/rcs/types/detached_webhook_info.rb +5 -3
  50. data/lib/rcs/types/dlc_campaign_status.rb +5 -3
  51. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +21 -19
  52. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +3 -3
  53. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_in.rb +6 -4
  54. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_out.rb +6 -4
  55. data/lib/rcs/types/extended_brand.rb +25 -13
  56. data/lib/rcs/types/extended_brand_with_vetting.rb +25 -13
  57. data/lib/rcs/types/extended_rcs_campaign.rb +25 -14
  58. data/lib/rcs/types/link_click_event.rb +1 -17
  59. data/lib/rcs/types/message.rb +5 -3
  60. data/lib/rcs/types/message_content.rb +4 -4
  61. data/lib/rcs/types/message_event.rb +143 -0
  62. data/lib/rcs/types/message_event_content.rb +127 -0
  63. data/lib/rcs/types/message_event_conversation.rb +82 -0
  64. data/lib/rcs/types/message_event_direction.rb +11 -0
  65. data/lib/rcs/types/message_event_mms_content.rb +94 -0
  66. data/lib/rcs/types/message_event_rcs_button_data.rb +104 -0
  67. data/lib/rcs/types/message_event_rcs_cards_content.rb +99 -0
  68. data/lib/rcs/types/message_event_rcs_cards_content_cards_item.rb +94 -0
  69. data/lib/rcs/types/message_event_rcs_location_data.rb +91 -0
  70. data/lib/rcs/types/message_event_rcs_media_content.rb +94 -0
  71. data/lib/rcs/types/message_event_rcs_text_content.rb +92 -0
  72. data/lib/rcs/types/message_event_sms_content.rb +81 -0
  73. data/lib/rcs/types/{retrieved_conversations.rb → message_list.rb} +26 -25
  74. data/lib/rcs/types/message_with_reaction.rb +197 -0
  75. data/lib/rcs/types/message_with_reaction_direction.rb +11 -0
  76. data/lib/rcs/types/{error_response.rb → not_found_error_body.rb} +7 -7
  77. data/lib/rcs/types/options.rb +111 -0
  78. data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +7 -3
  79. data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +7 -3
  80. data/lib/rcs/types/pinnacle_file_upload_metadata.rb +18 -2
  81. data/lib/rcs/types/profile_status_enum.rb +4 -4
  82. data/lib/rcs/types/rcs_base_options.rb +12 -1
  83. data/lib/rcs/types/rcs_button_call.rb +11 -2
  84. data/lib/rcs/types/rcs_button_open_url.rb +38 -2
  85. data/lib/rcs/types/rcs_button_open_url_webview_mode.rb +19 -0
  86. data/lib/rcs/types/rcs_button_request_user_location.rb +15 -3
  87. data/lib/rcs/types/rcs_button_schedule_event.rb +9 -1
  88. data/lib/rcs/types/rcs_button_send_location.rb +22 -2
  89. data/lib/rcs/types/rcs_button_trigger.rb +8 -6
  90. data/lib/rcs/types/rcs_campaign.rb +3 -3
  91. data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +8 -8
  92. data/lib/rcs/types/rcs_campaign_status.rb +5 -3
  93. data/lib/rcs/types/reaction_result.rb +10 -6
  94. data/lib/rcs/types/refreshed_file.rb +67 -0
  95. data/lib/rcs/types/rich_cards_message.rb +10 -10
  96. data/lib/rcs/types/{rcs.rb → rich_message.rb} +3 -3
  97. data/lib/rcs/types/scheduled_messaage.rb +5 -3
  98. data/lib/rcs/types/send_rcs_card_options.rb +132 -0
  99. data/lib/rcs/types/send_rcs_card_options_standalone_card.rb +78 -0
  100. data/lib/rcs/types/send_rcs_card_options_standalone_card_image_alignment.rb +12 -0
  101. data/lib/rcs/types/send_rcs_card_options_standalone_card_orientation.rb +11 -0
  102. data/lib/rcs/types/send_typing_indicator_response.rb +100 -0
  103. data/lib/rcs/types/sent_mms_details.rb +4 -2
  104. data/lib/rcs/types/sent_rcs_details.rb +12 -13
  105. data/lib/rcs/types/sent_sms_details.rb +5 -3
  106. data/lib/rcs/types/toll_free_campaign.rb +3 -3
  107. data/lib/rcs/types/toll_free_campaign_status.rb +5 -3
  108. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +3 -5
  109. data/lib/rcs/types/updated_contact_id.rb +5 -3
  110. data/lib/rcs/types/user_event.rb +83 -0
  111. data/lib/rcs/types/user_event_conversation.rb +78 -0
  112. data/lib/rcs/types/v_card_data.rb +5 -3
  113. data/lib/rcs/types/validate_campaign_params.rb +15 -3
  114. data/lib/rcs/types/vcard.rb +5 -3
  115. data/lib/rcs/types/vcard_content.rb +5 -3
  116. data/lib/rcs/types/vcard_resource.rb +5 -3
  117. data/lib/rcs/types/webhook_event_enum.rb +1 -0
  118. data/lib/rcs/types/webhooks.rb +5 -3
  119. data/lib/requests.rb +2 -2
  120. data/lib/types_export.rb +37 -7
  121. metadata +41 -11
  122. data/lib/rcs/types/click_action.rb +0 -73
  123. data/lib/rcs/types/click_action_data_metadata.rb +0 -69
@@ -0,0 +1,104 @@
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
+ # Button click event data received when a user clicks on an RCS button or quick
10
+ # reply (excluding `requestUserLocation` buttons).
11
+ # This event contains information about which button was clicked, how many times
12
+ # it's been clicked, and any payload or metadata attached to the button. Use this
13
+ # data to handle user interactions with your RCS messages.
14
+ class MessageEventRcsButtonData
15
+ # @return [String] Message type identifier.
16
+ attr_reader :type
17
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
18
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
19
+ # To get the message details, use the [GET
20
+ # /messages/{id}](/api-reference/messages/get) endpoint.
21
+ attr_reader :id
22
+ # @return [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
23
+ attr_reader :button
24
+ # @return [String] ID of the message this button was sent in, or null if not available. To get the
25
+ # message details, use the [GET /messages/{id}](/api-reference/messages/get)
26
+ # endpoint.
27
+ attr_reader :message_id
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param type [String] Message type identifier.
37
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
38
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
39
+ # To get the message details, use the [GET
40
+ # /messages/{id}](/api-reference/messages/get) endpoint.
41
+ # @param button [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
42
+ # @param message_id [String] ID of the message this button was sent in, or null if not available. To get the
43
+ # message details, use the [GET /messages/{id}](/api-reference/messages/get)
44
+ # endpoint.
45
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
46
+ # @return [Pinnacle::Types::MessageEventRcsButtonData]
47
+ def initialize(type:, id:, button:, message_id: OMIT, additional_properties: nil)
48
+ @type = type
49
+ @id = id
50
+ @button = button
51
+ @message_id = message_id if message_id != OMIT
52
+ @additional_properties = additional_properties
53
+ @_field_set = { "type": type, "id": id, "button": button, "messageId": message_id }.reject do |_k, v|
54
+ v == OMIT
55
+ end
56
+ end
57
+
58
+ # Deserialize a JSON object to an instance of MessageEventRcsButtonData
59
+ #
60
+ # @param json_object [String]
61
+ # @return [Pinnacle::Types::MessageEventRcsButtonData]
62
+ def self.from_json(json_object:)
63
+ struct = JSON.parse(json_object, object_class: OpenStruct)
64
+ parsed_json = JSON.parse(json_object)
65
+ type = parsed_json["type"]
66
+ id = parsed_json["id"]
67
+ if parsed_json["button"].nil?
68
+ button = nil
69
+ else
70
+ button = parsed_json["button"].to_json
71
+ button = Pinnacle::Types::ButtonClickedDataButton.from_json(json_object: button)
72
+ end
73
+ message_id = parsed_json["messageId"]
74
+ new(
75
+ type: type,
76
+ id: id,
77
+ button: button,
78
+ message_id: message_id,
79
+ additional_properties: struct
80
+ )
81
+ end
82
+
83
+ # Serialize an instance of MessageEventRcsButtonData to a JSON object
84
+ #
85
+ # @return [String]
86
+ def to_json(*_args)
87
+ @_field_set&.to_json
88
+ end
89
+
90
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
91
+ # hash and check each fields type against the current object's property
92
+ # definitions.
93
+ #
94
+ # @param obj [Object]
95
+ # @return [Void]
96
+ def self.validate_raw(obj:)
97
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
98
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
99
+ Pinnacle::Types::ButtonClickedDataButton.validate_raw(obj: obj.button)
100
+ obj.message_id&.is_a?(String) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "message_event_rcs_cards_content_cards_item"
4
+ require_relative "rich_button"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Types
10
+ # RCS message containing cards, each with its own title, subtitle, and/or buttons.
11
+ # Quick replies can also be added. <br>
12
+ # See [supported file
13
+ # types](https://app.pinnacle.sh/supported-file-types?type=RCS-CARD).
14
+ class MessageEventRcsCardsContent
15
+ # @return [String] Message type identifier.
16
+ attr_reader :type
17
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
18
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
19
+ # To get the message details, use the [GET
20
+ # /messages/{id}](/api-reference/messages/get) endpoint.
21
+ attr_reader :id
22
+ # @return [Array<Pinnacle::Types::MessageEventRcsCardsContentCardsItem>] Collection of cards attached to the message.
23
+ attr_reader :cards
24
+ # @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
25
+ attr_reader :quick_replies
26
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
27
+ attr_reader :additional_properties
28
+ # @return [Object]
29
+ attr_reader :_field_set
30
+ protected :_field_set
31
+
32
+ OMIT = Object.new
33
+
34
+ # @param type [String] Message type identifier.
35
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
36
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
37
+ # To get the message details, use the [GET
38
+ # /messages/{id}](/api-reference/messages/get) endpoint.
39
+ # @param cards [Array<Pinnacle::Types::MessageEventRcsCardsContentCardsItem>] Collection of cards attached to the message.
40
+ # @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
41
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
+ # @return [Pinnacle::Types::MessageEventRcsCardsContent]
43
+ def initialize(type:, id:, cards:, quick_replies:, additional_properties: nil)
44
+ @type = type
45
+ @id = id
46
+ @cards = cards
47
+ @quick_replies = quick_replies
48
+ @additional_properties = additional_properties
49
+ @_field_set = { "type": type, "id": id, "cards": cards, "quickReplies": quick_replies }
50
+ end
51
+
52
+ # Deserialize a JSON object to an instance of MessageEventRcsCardsContent
53
+ #
54
+ # @param json_object [String]
55
+ # @return [Pinnacle::Types::MessageEventRcsCardsContent]
56
+ def self.from_json(json_object:)
57
+ struct = JSON.parse(json_object, object_class: OpenStruct)
58
+ parsed_json = JSON.parse(json_object)
59
+ type = parsed_json["type"]
60
+ id = parsed_json["id"]
61
+ cards = parsed_json["cards"]&.map do |item|
62
+ item = item.to_json
63
+ Pinnacle::Types::MessageEventRcsCardsContentCardsItem.from_json(json_object: item)
64
+ end
65
+ quick_replies = parsed_json["quickReplies"]&.map do |item|
66
+ item = item.to_json
67
+ Pinnacle::Types::RichButton.from_json(json_object: item)
68
+ end
69
+ new(
70
+ type: type,
71
+ id: id,
72
+ cards: cards,
73
+ quick_replies: quick_replies,
74
+ additional_properties: struct
75
+ )
76
+ end
77
+
78
+ # Serialize an instance of MessageEventRcsCardsContent to a JSON object
79
+ #
80
+ # @return [String]
81
+ def to_json(*_args)
82
+ @_field_set&.to_json
83
+ end
84
+
85
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
86
+ # hash and check each fields type against the current object's property
87
+ # definitions.
88
+ #
89
+ # @param obj [Object]
90
+ # @return [Void]
91
+ def self.validate_raw(obj:)
92
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
93
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
94
+ obj.cards.is_a?(Array) != false || raise("Passed value for field obj.cards is not the expected type, validation failed.")
95
+ obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rich_button"
4
+ require_relative "rcs_media_details_content"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Types
10
+ # Individual card containing title, optional media, and action buttons.
11
+ class MessageEventRcsCardsContentCardsItem
12
+ # @return [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
13
+ attr_reader :buttons
14
+ # @return [Pinnacle::Types::RcsMediaDetailsContent]
15
+ attr_reader :media
16
+ # @return [String] Secondary text displayed below the title for additional context.
17
+ attr_reader :subtitle
18
+ # @return [String] Title displayed on the card.
19
+ attr_reader :title
20
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
21
+ attr_reader :additional_properties
22
+ # @return [Object]
23
+ attr_reader :_field_set
24
+ protected :_field_set
25
+
26
+ OMIT = Object.new
27
+
28
+ # @param buttons [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
29
+ # @param media [Pinnacle::Types::RcsMediaDetailsContent]
30
+ # @param subtitle [String] Secondary text displayed below the title for additional context.
31
+ # @param title [String] Title displayed on the card.
32
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
33
+ # @return [Pinnacle::Types::MessageEventRcsCardsContentCardsItem]
34
+ def initialize(buttons:, title:, media: OMIT, subtitle: OMIT, additional_properties: nil)
35
+ @buttons = buttons
36
+ @media = media if media != OMIT
37
+ @subtitle = subtitle if subtitle != OMIT
38
+ @title = title
39
+ @additional_properties = additional_properties
40
+ @_field_set = { "buttons": buttons, "media": media, "subtitle": subtitle, "title": title }.reject do |_k, v|
41
+ v == OMIT
42
+ end
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of MessageEventRcsCardsContentCardsItem
46
+ #
47
+ # @param json_object [String]
48
+ # @return [Pinnacle::Types::MessageEventRcsCardsContentCardsItem]
49
+ def self.from_json(json_object:)
50
+ struct = JSON.parse(json_object, object_class: OpenStruct)
51
+ parsed_json = JSON.parse(json_object)
52
+ buttons = parsed_json["buttons"]&.map do |item|
53
+ item = item.to_json
54
+ Pinnacle::Types::RichButton.from_json(json_object: item)
55
+ end
56
+ if parsed_json["media"].nil?
57
+ media = nil
58
+ else
59
+ media = parsed_json["media"].to_json
60
+ media = Pinnacle::Types::RcsMediaDetailsContent.from_json(json_object: media)
61
+ end
62
+ subtitle = parsed_json["subtitle"]
63
+ title = parsed_json["title"]
64
+ new(
65
+ buttons: buttons,
66
+ media: media,
67
+ subtitle: subtitle,
68
+ title: title,
69
+ additional_properties: struct
70
+ )
71
+ end
72
+
73
+ # Serialize an instance of MessageEventRcsCardsContentCardsItem to a JSON object
74
+ #
75
+ # @return [String]
76
+ def to_json(*_args)
77
+ @_field_set&.to_json
78
+ end
79
+
80
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
81
+ # hash and check each fields type against the current object's property
82
+ # definitions.
83
+ #
84
+ # @param obj [Object]
85
+ # @return [Void]
86
+ def self.validate_raw(obj:)
87
+ obj.buttons.is_a?(Array) != false || raise("Passed value for field obj.buttons is not the expected type, validation failed.")
88
+ obj.media.nil? || Pinnacle::Types::RcsMediaDetailsContent.validate_raw(obj: obj.media)
89
+ obj.subtitle&.is_a?(String) != false || raise("Passed value for field obj.subtitle is not the expected type, validation failed.")
90
+ obj.title.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "location_share_action_data"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Types
9
+ # Location sharing event data received when a user responds to a
10
+ # `requestUserLocation` button and shares their current location.
11
+ # This event contains the geographic coordinates (latitude/longitude) and
12
+ # human-readable address of the location the user chose to share. Use this data to
13
+ # process location-based requests or provide location-specific services.
14
+ class MessageEventRcsLocationData
15
+ # @return [String] Message type identifier.
16
+ attr_reader :type
17
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
18
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
19
+ # To get the message details, use the [GET
20
+ # /messages/{id}](/api-reference/messages/get) endpoint.
21
+ attr_reader :id
22
+ # @return [Pinnacle::Types::LocationShareActionData] Location data shared by the user.
23
+ attr_reader :data
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param type [String] Message type identifier.
33
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
34
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
35
+ # To get the message details, use the [GET
36
+ # /messages/{id}](/api-reference/messages/get) endpoint.
37
+ # @param data [Pinnacle::Types::LocationShareActionData] Location data shared by the user.
38
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
39
+ # @return [Pinnacle::Types::MessageEventRcsLocationData]
40
+ def initialize(type:, id:, data:, additional_properties: nil)
41
+ @type = type
42
+ @id = id
43
+ @data = data
44
+ @additional_properties = additional_properties
45
+ @_field_set = { "type": type, "id": id, "data": data }
46
+ end
47
+
48
+ # Deserialize a JSON object to an instance of MessageEventRcsLocationData
49
+ #
50
+ # @param json_object [String]
51
+ # @return [Pinnacle::Types::MessageEventRcsLocationData]
52
+ def self.from_json(json_object:)
53
+ struct = JSON.parse(json_object, object_class: OpenStruct)
54
+ parsed_json = JSON.parse(json_object)
55
+ type = parsed_json["type"]
56
+ id = parsed_json["id"]
57
+ if parsed_json["data"].nil?
58
+ data = nil
59
+ else
60
+ data = parsed_json["data"].to_json
61
+ data = Pinnacle::Types::LocationShareActionData.from_json(json_object: data)
62
+ end
63
+ new(
64
+ type: type,
65
+ id: id,
66
+ data: data,
67
+ additional_properties: struct
68
+ )
69
+ end
70
+
71
+ # Serialize an instance of MessageEventRcsLocationData to a JSON object
72
+ #
73
+ # @return [String]
74
+ def to_json(*_args)
75
+ @_field_set&.to_json
76
+ end
77
+
78
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
79
+ # hash and check each fields type against the current object's property
80
+ # definitions.
81
+ #
82
+ # @param obj [Object]
83
+ # @return [Void]
84
+ def self.validate_raw(obj:)
85
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
86
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
87
+ Pinnacle::Types::LocationShareActionData.validate_raw(obj: obj.data)
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rich_button"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Types
9
+ # RCS message containing a media file with optional quick reply buttons. <br>
10
+ # See [supported file
11
+ # types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
12
+ class MessageEventRcsMediaContent
13
+ # @return [String] Message type identifier.
14
+ attr_reader :type
15
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
16
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
17
+ # To get the message details, use the [GET
18
+ # /messages/{id}](/api-reference/messages/get) endpoint.
19
+ attr_reader :id
20
+ # @return [String] URL of the media file.
21
+ attr_reader :media
22
+ # @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
23
+ attr_reader :quick_replies
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param type [String] Message type identifier.
33
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
34
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
35
+ # To get the message details, use the [GET
36
+ # /messages/{id}](/api-reference/messages/get) endpoint.
37
+ # @param media [String] URL of the media file.
38
+ # @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
39
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
40
+ # @return [Pinnacle::Types::MessageEventRcsMediaContent]
41
+ def initialize(type:, id:, media:, quick_replies:, additional_properties: nil)
42
+ @type = type
43
+ @id = id
44
+ @media = media
45
+ @quick_replies = quick_replies
46
+ @additional_properties = additional_properties
47
+ @_field_set = { "type": type, "id": id, "media": media, "quickReplies": quick_replies }
48
+ end
49
+
50
+ # Deserialize a JSON object to an instance of MessageEventRcsMediaContent
51
+ #
52
+ # @param json_object [String]
53
+ # @return [Pinnacle::Types::MessageEventRcsMediaContent]
54
+ def self.from_json(json_object:)
55
+ struct = JSON.parse(json_object, object_class: OpenStruct)
56
+ parsed_json = JSON.parse(json_object)
57
+ type = parsed_json["type"]
58
+ id = parsed_json["id"]
59
+ media = parsed_json["media"]
60
+ quick_replies = parsed_json["quickReplies"]&.map do |item|
61
+ item = item.to_json
62
+ Pinnacle::Types::RichButton.from_json(json_object: item)
63
+ end
64
+ new(
65
+ type: type,
66
+ id: id,
67
+ media: media,
68
+ quick_replies: quick_replies,
69
+ additional_properties: struct
70
+ )
71
+ end
72
+
73
+ # Serialize an instance of MessageEventRcsMediaContent to a JSON object
74
+ #
75
+ # @return [String]
76
+ def to_json(*_args)
77
+ @_field_set&.to_json
78
+ end
79
+
80
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
81
+ # hash and check each fields type against the current object's property
82
+ # definitions.
83
+ #
84
+ # @param obj [Object]
85
+ # @return [Void]
86
+ def self.validate_raw(obj:)
87
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
88
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
89
+ obj.media.is_a?(String) != false || raise("Passed value for field obj.media is not the expected type, validation failed.")
90
+ obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rich_button"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Types
9
+ # RCS message containing longer text content with optional quick reply buttons.
10
+ class MessageEventRcsTextContent
11
+ # @return [String] Message type identifier.
12
+ attr_reader :type
13
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
14
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
15
+ # To get the message details, use the [GET
16
+ # /messages/{id}](/api-reference/messages/get) endpoint.
17
+ attr_reader :id
18
+ # @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
19
+ attr_reader :quick_replies
20
+ # @return [String] Text content of the RCS message.
21
+ attr_reader :text
22
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
23
+ attr_reader :additional_properties
24
+ # @return [Object]
25
+ attr_reader :_field_set
26
+ protected :_field_set
27
+
28
+ OMIT = Object.new
29
+
30
+ # @param type [String] Message type identifier.
31
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
32
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
33
+ # To get the message details, use the [GET
34
+ # /messages/{id}](/api-reference/messages/get) endpoint.
35
+ # @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
36
+ # @param text [String] Text content of the RCS message.
37
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
38
+ # @return [Pinnacle::Types::MessageEventRcsTextContent]
39
+ def initialize(type:, id:, quick_replies:, text:, additional_properties: nil)
40
+ @type = type
41
+ @id = id
42
+ @quick_replies = quick_replies
43
+ @text = text
44
+ @additional_properties = additional_properties
45
+ @_field_set = { "type": type, "id": id, "quickReplies": quick_replies, "text": text }
46
+ end
47
+
48
+ # Deserialize a JSON object to an instance of MessageEventRcsTextContent
49
+ #
50
+ # @param json_object [String]
51
+ # @return [Pinnacle::Types::MessageEventRcsTextContent]
52
+ def self.from_json(json_object:)
53
+ struct = JSON.parse(json_object, object_class: OpenStruct)
54
+ parsed_json = JSON.parse(json_object)
55
+ type = parsed_json["type"]
56
+ id = parsed_json["id"]
57
+ quick_replies = parsed_json["quickReplies"]&.map do |item|
58
+ item = item.to_json
59
+ Pinnacle::Types::RichButton.from_json(json_object: item)
60
+ end
61
+ text = parsed_json["text"]
62
+ new(
63
+ type: type,
64
+ id: id,
65
+ quick_replies: quick_replies,
66
+ text: text,
67
+ additional_properties: struct
68
+ )
69
+ end
70
+
71
+ # Serialize an instance of MessageEventRcsTextContent to a JSON object
72
+ #
73
+ # @return [String]
74
+ def to_json(*_args)
75
+ @_field_set&.to_json
76
+ end
77
+
78
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
79
+ # hash and check each fields type against the current object's property
80
+ # definitions.
81
+ #
82
+ # @param obj [Object]
83
+ # @return [Void]
84
+ def self.validate_raw(obj:)
85
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
86
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
87
+ obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
88
+ obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ # SMS message containing plain text only.
9
+ class MessageEventSmsContent
10
+ # @return [String] Message type identifier.
11
+ attr_reader :type
12
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
13
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
14
+ # To get the message details, use the [GET
15
+ # /messages/{id}](/api-reference/messages/get) endpoint.
16
+ attr_reader :id
17
+ # @return [String] Message content.
18
+ attr_reader :text
19
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
20
+ attr_reader :additional_properties
21
+ # @return [Object]
22
+ attr_reader :_field_set
23
+ protected :_field_set
24
+
25
+ OMIT = Object.new
26
+
27
+ # @param type [String] Message type identifier.
28
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
29
+ # with the prefix `msg_`, for example: `msg_1234567890`. <br><br>
30
+ # To get the message details, use the [GET
31
+ # /messages/{id}](/api-reference/messages/get) endpoint.
32
+ # @param text [String] Message content.
33
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
34
+ # @return [Pinnacle::Types::MessageEventSmsContent]
35
+ def initialize(type:, id:, text:, additional_properties: nil)
36
+ @type = type
37
+ @id = id
38
+ @text = text
39
+ @additional_properties = additional_properties
40
+ @_field_set = { "type": type, "id": id, "text": text }
41
+ end
42
+
43
+ # Deserialize a JSON object to an instance of MessageEventSmsContent
44
+ #
45
+ # @param json_object [String]
46
+ # @return [Pinnacle::Types::MessageEventSmsContent]
47
+ def self.from_json(json_object:)
48
+ struct = JSON.parse(json_object, object_class: OpenStruct)
49
+ parsed_json = JSON.parse(json_object)
50
+ type = parsed_json["type"]
51
+ id = parsed_json["id"]
52
+ text = parsed_json["text"]
53
+ new(
54
+ type: type,
55
+ id: id,
56
+ text: text,
57
+ additional_properties: struct
58
+ )
59
+ end
60
+
61
+ # Serialize an instance of MessageEventSmsContent 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
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
76
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
77
+ obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
78
+ end
79
+ end
80
+ end
81
+ end