rcs 2.0.0.pre.rc.4 → 2.0.0

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +36 -24
  3. data/lib/rcs/campaigns/dlc/client.rb +44 -34
  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/rcs/types/upsert_rcs_agent.rb +4 -4
  7. data/lib/rcs/campaigns/toll_free/client.rb +32 -26
  8. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +6 -6
  9. data/lib/rcs/contacts/client.rb +10 -8
  10. data/lib/rcs/conversations/client.rb +142 -14
  11. data/lib/rcs/conversations/types/conversations_list_messages_request_direction.rb +12 -0
  12. data/lib/rcs/conversations/types/conversations_list_messages_request_sort_order.rb +12 -0
  13. data/lib/rcs/conversations/types/conversations_list_messages_request_status.rb +17 -0
  14. data/lib/rcs/conversations/types/conversations_list_messages_request_type.rb +13 -0
  15. data/lib/rcs/messages/client.rb +12 -29
  16. data/lib/rcs/messages/mms/client.rb +2 -2
  17. data/lib/rcs/messages/rcs/client.rb +1 -1
  18. data/lib/rcs/messages/sms/client.rb +2 -2
  19. data/lib/rcs/phone_numbers/campaign/client.rb +20 -6
  20. data/lib/rcs/phone_numbers/client.rb +0 -14
  21. data/lib/rcs/phone_numbers/webhook/client.rb +12 -10
  22. data/lib/rcs/rcs/client.rb +330 -0
  23. data/lib/rcs/status/get/client.rb +34 -18
  24. data/lib/rcs/tools/contact_card/client.rb +18 -8
  25. data/lib/rcs/tools/file/client.rb +92 -2
  26. data/lib/rcs/tools/file/types/upload_file_options.rb +21 -3
  27. data/lib/rcs/tools/url/client.rb +4 -2
  28. data/lib/rcs/types/attach_webhook_by_id_params.rb +5 -5
  29. data/lib/rcs/types/attach_webhook_response_webhook.rb +5 -3
  30. data/lib/rcs/types/autofill_campaign_params.rb +15 -3
  31. data/lib/rcs/types/autofill_dlc_campaign_response.rb +10 -6
  32. data/lib/rcs/types/autofill_dlc_response_keywords.rb +8 -10
  33. data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +3 -3
  34. data/lib/rcs/types/autofill_dlc_response_keywords_opt_in.rb +6 -4
  35. data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +3 -3
  36. data/lib/rcs/types/autofill_dlc_response_options.rb +12 -12
  37. data/lib/rcs/types/brand_status.rb +5 -3
  38. data/lib/rcs/types/{inbound_button.rb → button_clicked.rb} +7 -7
  39. data/lib/rcs/types/button_clicked_data.rb +80 -0
  40. data/lib/rcs/types/button_clicked_data_button.rb +118 -0
  41. data/lib/rcs/types/{click_action_data.rb → button_clicked_data_button_raw.rb} +10 -8
  42. data/lib/rcs/types/button_clicked_data_button_type.rb +15 -0
  43. data/lib/rcs/types/campaign_query.rb +10 -2
  44. data/lib/rcs/types/contact.rb +5 -3
  45. data/lib/rcs/types/contact_id.rb +5 -3
  46. data/lib/rcs/types/conversation.rb +16 -8
  47. data/lib/rcs/types/conversation_by_id_params.rb +7 -3
  48. data/lib/rcs/types/conversation_contact.rb +5 -3
  49. data/lib/rcs/types/create_url_options.rb +4 -2
  50. data/lib/rcs/types/detached_webhook_info.rb +5 -3
  51. data/lib/rcs/types/dlc_campaign_status.rb +7 -5
  52. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +21 -19
  53. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +3 -3
  54. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_in.rb +6 -4
  55. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_out.rb +6 -4
  56. data/lib/rcs/types/extended_brand.rb +25 -13
  57. data/lib/rcs/types/extended_brand_with_vetting.rb +25 -13
  58. data/lib/rcs/types/extended_rcs_campaign.rb +25 -14
  59. data/lib/rcs/types/get_dlc_campaign_status_response_updates.rb +1 -1
  60. data/lib/rcs/types/link_click_event.rb +1 -17
  61. data/lib/rcs/types/message.rb +5 -3
  62. data/lib/rcs/types/message_content.rb +4 -4
  63. data/lib/rcs/types/message_event.rb +143 -0
  64. data/lib/rcs/types/message_event_content.rb +127 -0
  65. data/lib/rcs/types/message_event_conversation.rb +82 -0
  66. data/lib/rcs/types/message_event_direction.rb +11 -0
  67. data/lib/rcs/types/message_event_mms_content.rb +94 -0
  68. data/lib/rcs/types/message_event_rcs_button_data.rb +104 -0
  69. data/lib/rcs/types/message_event_rcs_cards_content.rb +99 -0
  70. data/lib/rcs/types/message_event_rcs_cards_content_cards_item.rb +94 -0
  71. data/lib/rcs/types/message_event_rcs_location_data.rb +91 -0
  72. data/lib/rcs/types/message_event_rcs_media_content.rb +94 -0
  73. data/lib/rcs/types/message_event_rcs_text_content.rb +92 -0
  74. data/lib/rcs/types/message_event_sms_content.rb +81 -0
  75. data/lib/rcs/types/message_list.rb +79 -0
  76. data/lib/rcs/types/message_schedule.rb +4 -5
  77. data/lib/rcs/types/message_with_reaction.rb +197 -0
  78. data/lib/rcs/types/message_with_reaction_direction.rb +11 -0
  79. data/lib/rcs/types/not_found_error_body.rb +59 -0
  80. data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +7 -3
  81. data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +7 -3
  82. data/lib/rcs/types/pinnacle_file_upload_metadata.rb +18 -2
  83. data/lib/rcs/types/profile_status_enum.rb +4 -4
  84. data/lib/rcs/types/rcs_base_options.rb +12 -1
  85. data/lib/rcs/types/rcs_button_call.rb +11 -2
  86. data/lib/rcs/types/rcs_button_open_url.rb +11 -2
  87. data/lib/rcs/types/rcs_button_request_user_location.rb +15 -3
  88. data/lib/rcs/types/rcs_button_schedule_event.rb +9 -1
  89. data/lib/rcs/types/rcs_button_send_location.rb +11 -2
  90. data/lib/rcs/types/rcs_button_trigger.rb +8 -6
  91. data/lib/rcs/types/rcs_campaign.rb +3 -3
  92. data/lib/rcs/types/rcs_campaign_schema_agent.rb +4 -4
  93. data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +12 -12
  94. data/lib/rcs/types/rcs_campaign_status.rb +5 -3
  95. data/lib/rcs/types/rcs_capabilities_result.rb +7 -0
  96. data/lib/rcs/types/rcs_capability.rb +82 -0
  97. data/lib/rcs/types/rcs_capability_actions.rb +105 -0
  98. data/lib/rcs/types/rcs_capability_cards.rb +67 -0
  99. data/lib/rcs/types/rcs_link_result.rb +75 -0
  100. data/lib/rcs/types/rcs_validate_content_media.rb +17 -3
  101. data/lib/rcs/types/rcs_whitelist_response.rb +58 -0
  102. data/lib/rcs/types/reaction_result.rb +10 -6
  103. data/lib/rcs/types/refreshed_file.rb +67 -0
  104. data/lib/rcs/types/{rcs.rb → rich_message.rb} +3 -3
  105. data/lib/rcs/types/scheduled_messaage.rb +5 -3
  106. data/lib/rcs/types/sent_mms_details.rb +4 -2
  107. data/lib/rcs/types/sent_rcs_details.rb +12 -13
  108. data/lib/rcs/types/sent_sms_details.rb +5 -3
  109. data/lib/rcs/types/toll_free_campaign.rb +3 -3
  110. data/lib/rcs/types/toll_free_campaign_status.rb +5 -3
  111. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +3 -5
  112. data/lib/rcs/types/updated_contact_id.rb +5 -3
  113. data/lib/rcs/types/user_event.rb +83 -0
  114. data/lib/rcs/types/user_event_conversation.rb +78 -0
  115. data/lib/rcs/types/v_card_data.rb +5 -3
  116. data/lib/rcs/types/validate_campaign_params.rb +15 -3
  117. data/lib/rcs/types/vcard.rb +5 -3
  118. data/lib/rcs/types/vcard_content.rb +5 -3
  119. data/lib/rcs/types/vcard_resource.rb +5 -3
  120. data/lib/rcs/types/webhook_event_enum.rb +1 -0
  121. data/lib/rcs/types/webhooks.rb +5 -3
  122. data/lib/rcs.rb +7 -0
  123. data/lib/requests.rb +2 -2
  124. data/lib/types_export.rb +35 -5
  125. metadata +40 -9
  126. data/lib/rcs/types/click_action.rb +0 -73
  127. data/lib/rcs/types/click_action_data_metadata.rb +0 -69
@@ -23,9 +23,9 @@ module Pinnacle
23
23
  # @param values [Array<String>] Keywords that trigger help response.
24
24
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
25
  # @return [Pinnacle::Types::DlcWithExtendedBrandAndStatusKeywordsHelp]
26
- def initialize(message: OMIT, values: OMIT, additional_properties: nil)
26
+ def initialize(values:, message: OMIT, additional_properties: nil)
27
27
  @message = message if message != OMIT
28
- @values = values if values != OMIT
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
@@ -65,7 +65,7 @@ module Pinnacle
65
65
  # @return [Void]
66
66
  def self.validate_raw(obj:)
67
67
  obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
68
- obj.values&.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
68
+ obj.values.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
69
69
  end
70
70
  end
71
71
  end
@@ -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::DlcWithExtendedBrandAndStatusKeywordsOptIn]
26
- def initialize(message:, values:, additional_properties: nil)
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
@@ -62,7 +64,7 @@ module Pinnacle
62
64
  # @param obj [Object]
63
65
  # @return [Void]
64
66
  def self.validate_raw(obj:)
65
- obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
67
+ obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
66
68
  obj.values.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
67
69
  end
68
70
  end
@@ -23,11 +23,13 @@ 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::DlcWithExtendedBrandAndStatusKeywordsOptOut]
26
- def initialize(message:, values:, additional_properties: nil)
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
@@ -62,7 +64,7 @@ module Pinnacle
62
64
  # @param obj [Object]
63
65
  # @return [Void]
64
66
  def self.validate_raw(obj:)
65
- obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
67
+ obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
66
68
  obj.values.is_a?(Array) != false || raise("Passed value for field obj.values is not the expected type, validation failed.")
67
69
  end
68
70
  end
@@ -12,15 +12,21 @@ module Pinnacle
12
12
  class ExtendedBrand
13
13
  # @return [String] ISO 8601 formatted timestamp of when this brand was added to our system.
14
14
  attr_reader :created_at
15
- # @return [Integer] The brand's ID.
15
+ # @return [String] The brand's ID. This identifier is a string that always begins with the prefix
16
+ # `b_`, for example: `b_1234567890`.
16
17
  attr_reader :id
17
18
  # @return [Boolean] Indicates if this brand is archived.
18
19
  attr_reader :is_archived
19
- # @return [Pinnacle::Types::BrandStatusEnum] Current review status of the campaign.<br>
20
- # `INCOMPLETE`: Not submitted.<br>
21
- # `IN REVIEW`: Being reviewed by carriers.<br>
22
- # `VERIFIED`: Approved and ready to send messages.<br>
23
- # `FAILED`: Issues and errors related to the campaign's details.
20
+ # @return [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
21
+ # `INCOMPLETE`: Not submitted. <br>
22
+ # `IN REVIEW`: Being reviewed by carriers. <br>
23
+ # `VERIFIED`: Approved and ready to send messages. <br>
24
+ # `FAILED`: Issues and errors related to the campaign's details. <br>
25
+ # `VETTED`: Has undergone additional vetting by a third party service post the
26
+ # brand being verified. Your brand will be assigned a trust score, with higher
27
+ # trust scores having higher message volumes. <br>
28
+ # `UNVERIFIED`: Brand details have been updated, and the brand will need to
29
+ # undergo re-verification.
24
30
  attr_reader :status
25
31
  # @return [String] ISO 8601 formatted timestamp of when this brand was last updated.
26
32
  attr_reader :updated_at
@@ -53,13 +59,19 @@ module Pinnacle
53
59
  OMIT = Object.new
54
60
 
55
61
  # @param created_at [String] ISO 8601 formatted timestamp of when this brand was added to our system.
56
- # @param id [Integer] The brand's ID.
62
+ # @param id [String] The brand's ID. This identifier is a string that always begins with the prefix
63
+ # `b_`, for example: `b_1234567890`.
57
64
  # @param is_archived [Boolean] Indicates if this brand is archived.
58
- # @param status [Pinnacle::Types::BrandStatusEnum] Current review status of the campaign.<br>
59
- # `INCOMPLETE`: Not submitted.<br>
60
- # `IN REVIEW`: Being reviewed by carriers.<br>
61
- # `VERIFIED`: Approved and ready to send messages.<br>
62
- # `FAILED`: Issues and errors related to the campaign's details.
65
+ # @param status [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
66
+ # `INCOMPLETE`: Not submitted. <br>
67
+ # `IN REVIEW`: Being reviewed by carriers. <br>
68
+ # `VERIFIED`: Approved and ready to send messages. <br>
69
+ # `FAILED`: Issues and errors related to the campaign's details. <br>
70
+ # `VETTED`: Has undergone additional vetting by a third party service post the
71
+ # brand being verified. Your brand will be assigned a trust score, with higher
72
+ # trust scores having higher message volumes. <br>
73
+ # `UNVERIFIED`: Brand details have been updated, and the brand will need to
74
+ # undergo re-verification.
63
75
  # @param updated_at [String] ISO 8601 formatted timestamp of when this brand was last updated.
64
76
  # @param address [String] Primary brand address where this brand is located.
65
77
  # @param contact [Pinnacle::Types::OptionalContacts]
@@ -174,7 +186,7 @@ module Pinnacle
174
186
  # @return [Void]
175
187
  def self.validate_raw(obj:)
176
188
  obj.created_at.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
177
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
189
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
178
190
  obj.is_archived.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
179
191
  obj.status.is_a?(Pinnacle::Types::BrandStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
180
192
  obj.updated_at.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
@@ -20,15 +20,21 @@ module Pinnacle
20
20
  attr_reader :vetting_history
21
21
  # @return [String] ISO 8601 formatted timestamp of when this brand was added to our system.
22
22
  attr_reader :created_at
23
- # @return [Integer] The brand's ID.
23
+ # @return [String] The brand's ID. This identifier is a string that always begins with the prefix
24
+ # `b_`, for example: `b_1234567890`.
24
25
  attr_reader :id
25
26
  # @return [Boolean] Indicates if this brand is archived.
26
27
  attr_reader :is_archived
27
- # @return [Pinnacle::Types::BrandStatusEnum] Current review status of the campaign.<br>
28
- # `INCOMPLETE`: Not submitted.<br>
29
- # `IN REVIEW`: Being reviewed by carriers.<br>
30
- # `VERIFIED`: Approved and ready to send messages.<br>
31
- # `FAILED`: Issues and errors related to the campaign's details.
28
+ # @return [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
29
+ # `INCOMPLETE`: Not submitted. <br>
30
+ # `IN REVIEW`: Being reviewed by carriers. <br>
31
+ # `VERIFIED`: Approved and ready to send messages. <br>
32
+ # `FAILED`: Issues and errors related to the campaign's details. <br>
33
+ # `VETTED`: Has undergone additional vetting by a third party service post the
34
+ # brand being verified. Your brand will be assigned a trust score, with higher
35
+ # trust scores having higher message volumes. <br>
36
+ # `UNVERIFIED`: Brand details have been updated, and the brand will need to
37
+ # undergo re-verification.
32
38
  attr_reader :status
33
39
  # @return [String] ISO 8601 formatted timestamp of when this brand was last updated.
34
40
  attr_reader :updated_at
@@ -64,13 +70,19 @@ module Pinnacle
64
70
  # @param tcr_feedback [Array<Pinnacle::Types::VettingFeedback>] Feedback from The Campaign Registry if TCR vetting was performed.
65
71
  # @param vetting_history [Array<Pinnacle::Types::VettingHistory>] History of all external vetting attempts for this brand.
66
72
  # @param created_at [String] ISO 8601 formatted timestamp of when this brand was added to our system.
67
- # @param id [Integer] The brand's ID.
73
+ # @param id [String] The brand's ID. This identifier is a string that always begins with the prefix
74
+ # `b_`, for example: `b_1234567890`.
68
75
  # @param is_archived [Boolean] Indicates if this brand is archived.
69
- # @param status [Pinnacle::Types::BrandStatusEnum] Current review status of the campaign.<br>
70
- # `INCOMPLETE`: Not submitted.<br>
71
- # `IN REVIEW`: Being reviewed by carriers.<br>
72
- # `VERIFIED`: Approved and ready to send messages.<br>
73
- # `FAILED`: Issues and errors related to the campaign's details.
76
+ # @param status [Pinnacle::Types::BrandStatusEnum] Current review status of the brand. <br>
77
+ # `INCOMPLETE`: Not submitted. <br>
78
+ # `IN REVIEW`: Being reviewed by carriers. <br>
79
+ # `VERIFIED`: Approved and ready to send messages. <br>
80
+ # `FAILED`: Issues and errors related to the campaign's details. <br>
81
+ # `VETTED`: Has undergone additional vetting by a third party service post the
82
+ # brand being verified. Your brand will be assigned a trust score, with higher
83
+ # trust scores having higher message volumes. <br>
84
+ # `UNVERIFIED`: Brand details have been updated, and the brand will need to
85
+ # undergo re-verification.
74
86
  # @param updated_at [String] ISO 8601 formatted timestamp of when this brand was last updated.
75
87
  # @param address [String] Primary brand address where this brand is located.
76
88
  # @param contact [Pinnacle::Types::OptionalContacts]
@@ -206,7 +218,7 @@ module Pinnacle
206
218
  obj.tcr_feedback&.is_a?(Array) != false || raise("Passed value for field obj.tcr_feedback is not the expected type, validation failed.")
207
219
  obj.vetting_history.is_a?(Array) != false || raise("Passed value for field obj.vetting_history is not the expected type, validation failed.")
208
220
  obj.created_at.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
209
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
221
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
210
222
  obj.is_archived.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
211
223
  obj.status.is_a?(Pinnacle::Types::BrandStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
212
224
  obj.updated_at.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
@@ -3,6 +3,7 @@
3
3
  require_relative "rcs_campaign_schema_extra_agent"
4
4
  require_relative "extended_brand"
5
5
  require_relative "rcs_campaign_schema_extra_links"
6
+ require_relative "profile_status_enum"
6
7
  require_relative "rcs_campaign_schema_extra_opt_in"
7
8
  require_relative "rcs_campaign_schema_extra_opt_out"
8
9
  require_relative "rcs_campaign_schema_extra_use_case"
@@ -24,12 +25,15 @@ module Pinnacle
24
25
  attr_reader :brand_verification_url
25
26
  # @return [Boolean] Indicates whether the brand has provided an attestation.
26
27
  attr_reader :brand_attestation
27
- # @return [Integer] Unique identifier for the campaign.
28
+ # @return [String] Unique identifier for the campaign. This identifier is a string that always
29
+ # begins with the prefix `rcs_`, for example: `rcs_1234567890`.
28
30
  attr_reader :campaign_id
29
31
  # @return [Array<String>] List of what the agent might say to users.
30
32
  attr_reader :expected_agent_responses
31
33
  # @return [Pinnacle::Types::RcsCampaignSchemaExtraLinks] Legal documentation links.
32
34
  attr_reader :links
35
+ # @return [Pinnacle::Types::ProfileStatusEnum]
36
+ attr_reader :status
33
37
  # @return [Pinnacle::Types::RcsCampaignSchemaExtraOptIn] Opt-in configuration.
34
38
  attr_reader :opt_in
35
39
  # @return [Pinnacle::Types::RcsCampaignSchemaExtraOptOut] Opt-out configuration.
@@ -51,27 +55,30 @@ module Pinnacle
51
55
  # incorporation, business license, or other relevant document. You can typically
52
56
  # find this on the Secretary of State website.
53
57
  # @param brand_attestation [Boolean] Indicates whether the brand has provided an attestation.
54
- # @param campaign_id [Integer] Unique identifier for the campaign.
58
+ # @param campaign_id [String] Unique identifier for the campaign. This identifier is a string that always
59
+ # begins with the prefix `rcs_`, for example: `rcs_1234567890`.
55
60
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users.
56
61
  # @param links [Pinnacle::Types::RcsCampaignSchemaExtraLinks] Legal documentation links.
62
+ # @param status [Pinnacle::Types::ProfileStatusEnum]
57
63
  # @param opt_in [Pinnacle::Types::RcsCampaignSchemaExtraOptIn] Opt-in configuration.
58
64
  # @param opt_out [Pinnacle::Types::RcsCampaignSchemaExtraOptOut] Opt-out configuration.
59
65
  # @param use_case [Pinnacle::Types::RcsCampaignSchemaExtraUseCase] Use case classification for the campaign.
60
66
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
61
67
  # @return [Pinnacle::Types::ExtendedRcsCampaign]
62
- def initialize(agent:, agent_id:, brand:, brand_attestation:, campaign_id:, links:, opt_in:, opt_out:, use_case:, brand_verification_url: OMIT,
63
- expected_agent_responses: OMIT, additional_properties: nil)
68
+ def initialize(agent:, agent_id:, brand:, brand_attestation:, status:, brand_verification_url: OMIT, campaign_id: OMIT,
69
+ expected_agent_responses: OMIT, links: OMIT, opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
64
70
  @agent = agent
65
71
  @agent_id = agent_id
66
72
  @brand = brand
67
73
  @brand_verification_url = brand_verification_url if brand_verification_url != OMIT
68
74
  @brand_attestation = brand_attestation
69
- @campaign_id = campaign_id
75
+ @campaign_id = campaign_id if campaign_id != OMIT
70
76
  @expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
71
- @links = links
72
- @opt_in = opt_in
73
- @opt_out = opt_out
74
- @use_case = use_case
77
+ @links = links if links != OMIT
78
+ @status = status
79
+ @opt_in = opt_in if opt_in != OMIT
80
+ @opt_out = opt_out if opt_out != OMIT
81
+ @use_case = use_case if use_case != OMIT
75
82
  @additional_properties = additional_properties
76
83
  @_field_set = {
77
84
  "agent": agent,
@@ -82,6 +89,7 @@ module Pinnacle
82
89
  "campaignId": campaign_id,
83
90
  "expectedAgentResponses": expected_agent_responses,
84
91
  "links": links,
92
+ "status": status,
85
93
  "optIn": opt_in,
86
94
  "optOut": opt_out,
87
95
  "useCase": use_case
@@ -120,6 +128,7 @@ module Pinnacle
120
128
  links = parsed_json["links"].to_json
121
129
  links = Pinnacle::Types::RcsCampaignSchemaExtraLinks.from_json(json_object: links)
122
130
  end
131
+ status = parsed_json["status"]
123
132
  if parsed_json["optIn"].nil?
124
133
  opt_in = nil
125
134
  else
@@ -147,6 +156,7 @@ module Pinnacle
147
156
  campaign_id: campaign_id,
148
157
  expected_agent_responses: expected_agent_responses,
149
158
  links: links,
159
+ status: status,
150
160
  opt_in: opt_in,
151
161
  opt_out: opt_out,
152
162
  use_case: use_case,
@@ -173,12 +183,13 @@ module Pinnacle
173
183
  Pinnacle::Types::ExtendedBrand.validate_raw(obj: obj.brand)
174
184
  obj.brand_verification_url&.is_a?(String) != false || raise("Passed value for field obj.brand_verification_url is not the expected type, validation failed.")
175
185
  obj.brand_attestation.is_a?(Boolean) != false || raise("Passed value for field obj.brand_attestation is not the expected type, validation failed.")
176
- obj.campaign_id.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
186
+ obj.campaign_id&.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
177
187
  obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
178
- Pinnacle::Types::RcsCampaignSchemaExtraLinks.validate_raw(obj: obj.links)
179
- Pinnacle::Types::RcsCampaignSchemaExtraOptIn.validate_raw(obj: obj.opt_in)
180
- Pinnacle::Types::RcsCampaignSchemaExtraOptOut.validate_raw(obj: obj.opt_out)
181
- Pinnacle::Types::RcsCampaignSchemaExtraUseCase.validate_raw(obj: obj.use_case)
188
+ obj.links.nil? || Pinnacle::Types::RcsCampaignSchemaExtraLinks.validate_raw(obj: obj.links)
189
+ obj.status.is_a?(Pinnacle::Types::ProfileStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
190
+ obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaExtraOptIn.validate_raw(obj: obj.opt_in)
191
+ obj.opt_out.nil? || Pinnacle::Types::RcsCampaignSchemaExtraOptOut.validate_raw(obj: obj.opt_out)
192
+ obj.use_case.nil? || Pinnacle::Types::RcsCampaignSchemaExtraUseCase.validate_raw(obj: obj.use_case)
182
193
  end
183
194
  end
184
195
  end
@@ -6,7 +6,7 @@ require "json"
6
6
 
7
7
  module Pinnacle
8
8
  module Types
9
- # Status of toll free numbers that are being attached to this campaign. <br>
9
+ # Status of local long code numbers that are being attached to this campaign. <br>
10
10
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
11
11
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
12
12
  class GetDlcCampaignStatusResponseUpdates
@@ -40,8 +40,6 @@ module Pinnacle
40
40
  attr_reader :fingerprint_id
41
41
  # @return [String] Google Click Identifier.
42
42
  attr_reader :gclid
43
- # @return [Integer] Unique identifier for the click event.
44
- attr_reader :id
45
43
  # @return [String] IP address of the visitor (may be anonymized).
46
44
  attr_reader :ip_address
47
45
  # @return [Array<String>] Chain of IP addresses for proxied requests.
@@ -52,8 +50,6 @@ module Pinnacle
52
50
  attr_reader :latency_ms
53
51
  # @return [Float] Geographic latitude.
54
52
  attr_reader :latitude
55
- # @return [Integer] ID of your shortened URL.
56
- attr_reader :link_id
57
53
  # @return [Float] Geographic longitude.
58
54
  attr_reader :longitude
59
55
  # @return [Hash{String => Object}] Additional metadata as JSON object.
@@ -133,13 +129,11 @@ module Pinnacle
133
129
  # @param final_url [String] Final resolved URL after redirects.
134
130
  # @param fingerprint_id [String] Unique fingerprint identifier for the client.
135
131
  # @param gclid [String] Google Click Identifier.
136
- # @param id [Integer] Unique identifier for the click event.
137
132
  # @param ip_address [String] IP address of the visitor (may be anonymized).
138
133
  # @param ip_chain [Array<String>] Chain of IP addresses for proxied requests.
139
134
  # @param is_bot [Boolean] Whether the request was identified as coming from a bot.
140
135
  # @param latency_ms [Integer] Request latency in milliseconds.
141
136
  # @param latitude [Float] Geographic latitude.
142
- # @param link_id [Integer] ID of your shortened URL.
143
137
  # @param longitude [Float] Geographic longitude.
144
138
  # @param metadata [Hash{String => Object}] Additional metadata as JSON object.
145
139
  # @param method_ [String] HTTP method used.
@@ -169,7 +163,7 @@ module Pinnacle
169
163
  # @param utm_term [String] UTM term.
170
164
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
171
165
  # @return [Pinnacle::Types::LinkClickEvent]
172
- def initialize(created_at:, id:, link_id:, accept_language: OMIT, accuracy_radius_km: OMIT, asn: OMIT, blocked_reason: OMIT,
166
+ def initialize(created_at:, accept_language: OMIT, accuracy_radius_km: OMIT, asn: OMIT, blocked_reason: OMIT,
173
167
  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
168
  @accept_language = accept_language if accept_language != OMIT
175
169
  @accuracy_radius_km = accuracy_radius_km if accuracy_radius_km != OMIT
@@ -188,13 +182,11 @@ module Pinnacle
188
182
  @final_url = final_url if final_url != OMIT
189
183
  @fingerprint_id = fingerprint_id if fingerprint_id != OMIT
190
184
  @gclid = gclid if gclid != OMIT
191
- @id = id
192
185
  @ip_address = ip_address if ip_address != OMIT
193
186
  @ip_chain = ip_chain if ip_chain != OMIT
194
187
  @is_bot = is_bot if is_bot != OMIT
195
188
  @latency_ms = latency_ms if latency_ms != OMIT
196
189
  @latitude = latitude if latitude != OMIT
197
- @link_id = link_id
198
190
  @longitude = longitude if longitude != OMIT
199
191
  @metadata = metadata if metadata != OMIT
200
192
  @method_ = method_ if method_ != OMIT
@@ -241,13 +233,11 @@ module Pinnacle
241
233
  "final_url": final_url,
242
234
  "fingerprint_id": fingerprint_id,
243
235
  "gclid": gclid,
244
- "id": id,
245
236
  "ip_address": ip_address,
246
237
  "ip_chain": ip_chain,
247
238
  "is_bot": is_bot,
248
239
  "latency_ms": latency_ms,
249
240
  "latitude": latitude,
250
- "link_id": link_id,
251
241
  "longitude": longitude,
252
242
  "metadata": metadata,
253
243
  "method": method_,
@@ -304,13 +294,11 @@ module Pinnacle
304
294
  final_url = parsed_json["final_url"]
305
295
  fingerprint_id = parsed_json["fingerprint_id"]
306
296
  gclid = parsed_json["gclid"]
307
- id = parsed_json["id"]
308
297
  ip_address = parsed_json["ip_address"]
309
298
  ip_chain = parsed_json["ip_chain"]
310
299
  is_bot = parsed_json["is_bot"]
311
300
  latency_ms = parsed_json["latency_ms"]
312
301
  latitude = parsed_json["latitude"]
313
- link_id = parsed_json["link_id"]
314
302
  longitude = parsed_json["longitude"]
315
303
  metadata = parsed_json["metadata"]
316
304
  method_ = parsed_json["method"]
@@ -356,13 +344,11 @@ module Pinnacle
356
344
  final_url: final_url,
357
345
  fingerprint_id: fingerprint_id,
358
346
  gclid: gclid,
359
- id: id,
360
347
  ip_address: ip_address,
361
348
  ip_chain: ip_chain,
362
349
  is_bot: is_bot,
363
350
  latency_ms: latency_ms,
364
351
  latitude: latitude,
365
- link_id: link_id,
366
352
  longitude: longitude,
367
353
  metadata: metadata,
368
354
  method_: method_,
@@ -425,13 +411,11 @@ module Pinnacle
425
411
  obj.final_url&.is_a?(String) != false || raise("Passed value for field obj.final_url is not the expected type, validation failed.")
426
412
  obj.fingerprint_id&.is_a?(String) != false || raise("Passed value for field obj.fingerprint_id is not the expected type, validation failed.")
427
413
  obj.gclid&.is_a?(String) != false || raise("Passed value for field obj.gclid is not the expected type, validation failed.")
428
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
429
414
  obj.ip_address&.is_a?(String) != false || raise("Passed value for field obj.ip_address is not the expected type, validation failed.")
430
415
  obj.ip_chain&.is_a?(Array) != false || raise("Passed value for field obj.ip_chain is not the expected type, validation failed.")
431
416
  obj.is_bot&.is_a?(Boolean) != false || raise("Passed value for field obj.is_bot is not the expected type, validation failed.")
432
417
  obj.latency_ms&.is_a?(Integer) != false || raise("Passed value for field obj.latency_ms is not the expected type, validation failed.")
433
418
  obj.latitude&.is_a?(Float) != false || raise("Passed value for field obj.latitude is not the expected type, validation failed.")
434
- obj.link_id.is_a?(Integer) != false || raise("Passed value for field obj.link_id is not the expected type, validation failed.")
435
419
  obj.longitude&.is_a?(Float) != false || raise("Passed value for field obj.longitude is not the expected type, validation failed.")
436
420
  obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
437
421
  obj.method_&.is_a?(String) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
@@ -23,7 +23,8 @@ module Pinnacle
23
23
  # <br>
24
24
  # Null indicates no errors.
25
25
  attr_reader :error
26
- # @return [Integer] Unique identifier of the message.
26
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
27
+ # with the prefix `msg_`, for example: `msg_1234567890`.
27
28
  attr_reader :id
28
29
  # @return [Pinnacle::Types::MessageMethodEnum]
29
30
  attr_reader :method_
@@ -57,7 +58,8 @@ module Pinnacle
57
58
  # @param error [String] Detailed explanation of any errors that occurred while delivering the message.
58
59
  # <br>
59
60
  # Null indicates no errors.
60
- # @param id [Integer] Unique identifier of the message.
61
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
62
+ # with the prefix `msg_`, for example: `msg_1234567890`.
61
63
  # @param method_ [Pinnacle::Types::MessageMethodEnum]
62
64
  # @param num_segments [Integer] Number of segments the message was split into for delivery.
63
65
  # @param receiver [String] Phone number that received the message in E.164 format.
@@ -160,7 +162,7 @@ module Pinnacle
160
162
  obj.cost&.is_a?(Float) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.")
161
163
  obj.delivered_at&.is_a?(String) != false || raise("Passed value for field obj.delivered_at is not the expected type, validation failed.")
162
164
  obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
163
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
165
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
164
166
  obj.method_.is_a?(Pinnacle::Types::MessageMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
165
167
  obj.num_segments.is_a?(Integer) != false || raise("Passed value for field obj.num_segments is not the expected type, validation failed.")
166
168
  obj.receiver.is_a?(String) != false || raise("Passed value for field obj.receiver is not the expected type, validation failed.")
@@ -4,7 +4,7 @@ require "json"
4
4
  require_relative "sms_content"
5
5
  require_relative "mms_content"
6
6
  require_relative "rcs_content"
7
- require_relative "inbound_button"
7
+ require_relative "button_clicked"
8
8
 
9
9
  module Pinnacle
10
10
  module Types
@@ -41,8 +41,8 @@ module Pinnacle
41
41
  # noop
42
42
  end
43
43
  begin
44
- Pinnacle::Types::InboundButton.validate_raw(obj: struct)
45
- return Pinnacle::Types::InboundButton.from_json(json_object: struct) unless struct.nil?
44
+ Pinnacle::Types::ButtonClicked.validate_raw(obj: struct)
45
+ return Pinnacle::Types::ButtonClicked.from_json(json_object: struct) unless struct.nil?
46
46
 
47
47
  return nil
48
48
  rescue StandardError
@@ -74,7 +74,7 @@ module Pinnacle
74
74
  # noop
75
75
  end
76
76
  begin
77
- return Pinnacle::Types::InboundButton.validate_raw(obj: obj)
77
+ return Pinnacle::Types::ButtonClicked.validate_raw(obj: obj)
78
78
  rescue StandardError
79
79
  # noop
80
80
  end
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "webhook_event_enum"
4
+ require_relative "message_event_conversation"
5
+ require_relative "message_status_enum"
6
+ require_relative "message_event_direction"
7
+ require_relative "message_event_content"
8
+ require "ostruct"
9
+ require "json"
10
+
11
+ module Pinnacle
12
+ module Types
13
+ # Represents an incoming message or message status update received via webhook.
14
+ class MessageEvent
15
+ # @return [Pinnacle::Types::WebhookEventEnum] Type of webhook event. MESSAGE.STATUS for message status updates or
16
+ # MESSAGE.RECEIVED for inbound messages.
17
+ attr_reader :type
18
+ # @return [Pinnacle::Types::MessageEventConversation] Conversation metadata containing the conversation ID, sender, and recipient
19
+ # information.
20
+ attr_reader :conversation
21
+ # @return [Pinnacle::Types::MessageStatusEnum]
22
+ attr_reader :status
23
+ # @return [Pinnacle::Types::MessageEventDirection] Direction of the message flow.
24
+ attr_reader :direction
25
+ # @return [Integer] Number of segments for this message.
26
+ attr_reader :segments
27
+ # @return [String] Timestamp when the message was sent in ISO 8601 format.
28
+ attr_reader :sent_at
29
+ # @return [String] Timestamp when the message was delivered in ISO 8601 format.
30
+ # Null if not yet delivered or for inbound messages.
31
+ attr_reader :delivered_at
32
+ # @return [Pinnacle::Types::MessageEventContent]
33
+ attr_reader :message
34
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
35
+ attr_reader :additional_properties
36
+ # @return [Object]
37
+ attr_reader :_field_set
38
+ protected :_field_set
39
+
40
+ OMIT = Object.new
41
+
42
+ # @param type [Pinnacle::Types::WebhookEventEnum] Type of webhook event. MESSAGE.STATUS for message status updates or
43
+ # MESSAGE.RECEIVED for inbound messages.
44
+ # @param conversation [Pinnacle::Types::MessageEventConversation] Conversation metadata containing the conversation ID, sender, and recipient
45
+ # information.
46
+ # @param status [Pinnacle::Types::MessageStatusEnum]
47
+ # @param direction [Pinnacle::Types::MessageEventDirection] Direction of the message flow.
48
+ # @param segments [Integer] Number of segments for this message.
49
+ # @param sent_at [String] Timestamp when the message was sent in ISO 8601 format.
50
+ # @param delivered_at [String] Timestamp when the message was delivered in ISO 8601 format.
51
+ # Null if not yet delivered or for inbound messages.
52
+ # @param message [Pinnacle::Types::MessageEventContent]
53
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
54
+ # @return [Pinnacle::Types::MessageEvent]
55
+ def initialize(type:, conversation:, status:, direction:, segments:, sent_at:, message:, delivered_at: OMIT,
56
+ additional_properties: nil)
57
+ @type = type
58
+ @conversation = conversation
59
+ @status = status
60
+ @direction = direction
61
+ @segments = segments
62
+ @sent_at = sent_at
63
+ @delivered_at = delivered_at if delivered_at != OMIT
64
+ @message = message
65
+ @additional_properties = additional_properties
66
+ @_field_set = {
67
+ "type": type,
68
+ "conversation": conversation,
69
+ "status": status,
70
+ "direction": direction,
71
+ "segments": segments,
72
+ "sentAt": sent_at,
73
+ "deliveredAt": delivered_at,
74
+ "message": message
75
+ }.reject do |_k, v|
76
+ v == OMIT
77
+ end
78
+ end
79
+
80
+ # Deserialize a JSON object to an instance of MessageEvent
81
+ #
82
+ # @param json_object [String]
83
+ # @return [Pinnacle::Types::MessageEvent]
84
+ def self.from_json(json_object:)
85
+ struct = JSON.parse(json_object, object_class: OpenStruct)
86
+ parsed_json = JSON.parse(json_object)
87
+ type = parsed_json["type"]
88
+ if parsed_json["conversation"].nil?
89
+ conversation = nil
90
+ else
91
+ conversation = parsed_json["conversation"].to_json
92
+ conversation = Pinnacle::Types::MessageEventConversation.from_json(json_object: conversation)
93
+ end
94
+ status = parsed_json["status"]
95
+ direction = parsed_json["direction"]
96
+ segments = parsed_json["segments"]
97
+ sent_at = parsed_json["sentAt"]
98
+ delivered_at = parsed_json["deliveredAt"]
99
+ if parsed_json["message"].nil?
100
+ message = nil
101
+ else
102
+ message = parsed_json["message"].to_json
103
+ message = Pinnacle::Types::MessageEventContent.from_json(json_object: message)
104
+ end
105
+ new(
106
+ type: type,
107
+ conversation: conversation,
108
+ status: status,
109
+ direction: direction,
110
+ segments: segments,
111
+ sent_at: sent_at,
112
+ delivered_at: delivered_at,
113
+ message: message,
114
+ additional_properties: struct
115
+ )
116
+ end
117
+
118
+ # Serialize an instance of MessageEvent to a JSON object
119
+ #
120
+ # @return [String]
121
+ def to_json(*_args)
122
+ @_field_set&.to_json
123
+ end
124
+
125
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
126
+ # hash and check each fields type against the current object's property
127
+ # definitions.
128
+ #
129
+ # @param obj [Object]
130
+ # @return [Void]
131
+ def self.validate_raw(obj:)
132
+ obj.type.is_a?(Pinnacle::Types::WebhookEventEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
133
+ Pinnacle::Types::MessageEventConversation.validate_raw(obj: obj.conversation)
134
+ obj.status.is_a?(Pinnacle::Types::MessageStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
135
+ obj.direction.is_a?(Pinnacle::Types::MessageEventDirection) != false || raise("Passed value for field obj.direction is not the expected type, validation failed.")
136
+ obj.segments.is_a?(Integer) != false || raise("Passed value for field obj.segments is not the expected type, validation failed.")
137
+ obj.sent_at.is_a?(String) != false || raise("Passed value for field obj.sent_at is not the expected type, validation failed.")
138
+ obj.delivered_at&.is_a?(String) != false || raise("Passed value for field obj.delivered_at is not the expected type, validation failed.")
139
+ Pinnacle::Types::MessageEventContent.validate_raw(obj: obj.message)
140
+ end
141
+ end
142
+ end
143
+ end