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
@@ -7,7 +7,8 @@ require "json"
7
7
  module Pinnacle
8
8
  module Types
9
9
  class ScheduledMessaage
10
- # @return [Integer] Unique identifier for the scheduled send.
10
+ # @return [String] Unique identifier for the scheduled send. This identifier is a string that
11
+ # always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
11
12
  attr_reader :schedule_id
12
13
  # @return [Pinnacle::Types::ScheduledSendResponseConfig] Configuration for the scheduled message.
13
14
  attr_reader :config
@@ -19,7 +20,8 @@ module Pinnacle
19
20
 
20
21
  OMIT = Object.new
21
22
 
22
- # @param schedule_id [Integer] Unique identifier for the scheduled send.
23
+ # @param schedule_id [String] Unique identifier for the scheduled send. This identifier is a string that
24
+ # always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
23
25
  # @param config [Pinnacle::Types::ScheduledSendResponseConfig] Configuration for the scheduled message.
24
26
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
27
  # @return [Pinnacle::Types::ScheduledMessaage]
@@ -65,7 +67,7 @@ module Pinnacle
65
67
  # @param obj [Object]
66
68
  # @return [Void]
67
69
  def self.validate_raw(obj:)
68
- obj.schedule_id.is_a?(Integer) != false || raise("Passed value for field obj.schedule_id is not the expected type, validation failed.")
70
+ obj.schedule_id.is_a?(String) != false || raise("Passed value for field obj.schedule_id is not the expected type, validation failed.")
69
71
  Pinnacle::Types::ScheduledSendResponseConfig.validate_raw(obj: obj.config)
70
72
  end
71
73
  end
@@ -6,7 +6,8 @@ require "json"
6
6
  module Pinnacle
7
7
  module Types
8
8
  class SentMmsDetails
9
- # @return [Array<Integer>] Array of unique identifiers for the sent MMS messages.
9
+ # @return [Array<String>] Array of unique identifiers for the sent MMS messages. This identifiers are
10
+ # strings that always begin with the prefix `msg_`, for example: `msg_1234567890`.
10
11
  attr_reader :message_ids
11
12
  # @return [Float] Total number of segments used across the message.
12
13
  attr_reader :segments
@@ -26,7 +27,8 @@ module Pinnacle
26
27
 
27
28
  OMIT = Object.new
28
29
 
29
- # @param message_ids [Array<Integer>] Array of unique identifiers for the sent MMS messages.
30
+ # @param message_ids [Array<String>] Array of unique identifiers for the sent MMS messages. This identifiers are
31
+ # strings that always begin with the prefix `msg_`, for example: `msg_1234567890`.
30
32
  # @param segments [Float] Total number of segments used across the message.
31
33
  # @param total_cost [Float] Total cost of sending the message.
32
34
  # @param sender [String] Sender's phone number in E.164 format.
@@ -6,8 +6,9 @@ require "json"
6
6
  module Pinnacle
7
7
  module Types
8
8
  class SentRcsDetails
9
- # @return [Float] Unique identifier for the sent MMS messages.
10
- attr_reader :message_ids
9
+ # @return [String] Unique identifier for the sent RCS message. This identifier is a string that
10
+ # always begins with the prefix `msg_`, for example: `msg_1234567890`.
11
+ attr_reader :message_id
11
12
  # @return [Integer] Total number of segments used across the message.
12
13
  attr_reader :segments
13
14
  # @return [Float] Total cost of sending the message.
@@ -26,7 +27,8 @@ module Pinnacle
26
27
 
27
28
  OMIT = Object.new
28
29
 
29
- # @param message_ids [Float] Unique identifier for the sent MMS messages.
30
+ # @param message_id [String] Unique identifier for the sent RCS message. This identifier is a string that
31
+ # always begins with the prefix `msg_`, for example: `msg_1234567890`.
30
32
  # @param segments [Integer] Total number of segments used across the message.
31
33
  # @param total_cost [Float] Total cost of sending the message.
32
34
  # @param sender [String] Sender's phone number in E.164 format.
@@ -34,9 +36,8 @@ module Pinnacle
34
36
  # @param status [String] Current status of the message.
35
37
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
36
38
  # @return [Pinnacle::Types::SentRcsDetails]
37
- def initialize(segments:, total_cost:, sender:, recipient:, status:, message_ids: OMIT,
38
- additional_properties: nil)
39
- @message_ids = message_ids if message_ids != OMIT
39
+ def initialize(message_id:, segments:, total_cost:, sender:, recipient:, status:, additional_properties: nil)
40
+ @message_id = message_id
40
41
  @segments = segments
41
42
  @total_cost = total_cost
42
43
  @sender = sender
@@ -44,15 +45,13 @@ module Pinnacle
44
45
  @status = status
45
46
  @additional_properties = additional_properties
46
47
  @_field_set = {
47
- "messageIds": message_ids,
48
+ "messageId": message_id,
48
49
  "segments": segments,
49
50
  "totalCost": total_cost,
50
51
  "sender": sender,
51
52
  "recipient": recipient,
52
53
  "status": status
53
- }.reject do |_k, v|
54
- v == OMIT
55
- end
54
+ }
56
55
  end
57
56
 
58
57
  # Deserialize a JSON object to an instance of SentRcsDetails
@@ -62,14 +61,14 @@ module Pinnacle
62
61
  def self.from_json(json_object:)
63
62
  struct = JSON.parse(json_object, object_class: OpenStruct)
64
63
  parsed_json = JSON.parse(json_object)
65
- message_ids = parsed_json["messageIds"]
64
+ message_id = parsed_json["messageId"]
66
65
  segments = parsed_json["segments"]
67
66
  total_cost = parsed_json["totalCost"]
68
67
  sender = parsed_json["sender"]
69
68
  recipient = parsed_json["recipient"]
70
69
  status = parsed_json["status"]
71
70
  new(
72
- message_ids: message_ids,
71
+ message_id: message_id,
73
72
  segments: segments,
74
73
  total_cost: total_cost,
75
74
  sender: sender,
@@ -93,7 +92,7 @@ module Pinnacle
93
92
  # @param obj [Object]
94
93
  # @return [Void]
95
94
  def self.validate_raw(obj:)
96
- obj.message_ids&.is_a?(Float) != false || raise("Passed value for field obj.message_ids is not the expected type, validation failed.")
95
+ obj.message_id.is_a?(String) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
97
96
  obj.segments.is_a?(Integer) != false || raise("Passed value for field obj.segments is not the expected type, validation failed.")
98
97
  obj.total_cost.is_a?(Float) != false || raise("Passed value for field obj.total_cost is not the expected type, validation failed.")
99
98
  obj.sender.is_a?(String) != false || raise("Passed value for field obj.sender is not the expected type, validation failed.")
@@ -7,7 +7,8 @@ require "json"
7
7
  module Pinnacle
8
8
  module Types
9
9
  class SentSmsDetails
10
- # @return [Integer] Unique identifier for the sent message.
10
+ # @return [String] Unique identifier for the sent message. This identifier is a string that always
11
+ # begins with the prefix `msg_`, for example: `msg_1234567890`.
11
12
  attr_reader :message_id
12
13
  # @return [Pinnacle::Types::SendSmsResponseSegments] Details about how the message was segmented for sending.
13
14
  attr_reader :segments
@@ -27,7 +28,8 @@ module Pinnacle
27
28
 
28
29
  OMIT = Object.new
29
30
 
30
- # @param message_id [Integer] Unique identifier for the sent message.
31
+ # @param message_id [String] Unique identifier for the sent message. This identifier is a string that always
32
+ # begins with the prefix `msg_`, for example: `msg_1234567890`.
31
33
  # @param segments [Pinnacle::Types::SendSmsResponseSegments] Details about how the message was segmented for sending.
32
34
  # @param total_cost [Float] Total cost of sending the message.
33
35
  # @param sender [String] Sender's phone number in E.164 format.
@@ -96,7 +98,7 @@ module Pinnacle
96
98
  # @param obj [Object]
97
99
  # @return [Void]
98
100
  def self.validate_raw(obj:)
99
- obj.message_id.is_a?(Integer) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
101
+ obj.message_id.is_a?(String) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
100
102
  Pinnacle::Types::SendSmsResponseSegments.validate_raw(obj: obj.segments)
101
103
  obj.total_cost.is_a?(Float) != false || raise("Passed value for field obj.total_cost is not the expected type, validation failed.")
102
104
  obj.sender.is_a?(String) != false || raise("Passed value for field obj.sender is not the expected type, validation failed.")
@@ -9,7 +9,7 @@ require "json"
9
9
  module Pinnacle
10
10
  module Types
11
11
  class TollFreeCampaign
12
- # @return [Integer] Unique identifier for the campaign.
12
+ # @return [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
13
13
  attr_reader :campaign_id
14
14
  # @return [Pinnacle::Types::MessageVolumeEnum]
15
15
  attr_reader :monthly_volume
@@ -29,7 +29,7 @@ module Pinnacle
29
29
 
30
30
  OMIT = Object.new
31
31
 
32
- # @param campaign_id [Integer] Unique identifier for the campaign.
32
+ # @param campaign_id [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
33
33
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
34
34
  # @param name [String] Display name of the campaign.
35
35
  # @param opt_in [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
@@ -106,7 +106,7 @@ module Pinnacle
106
106
  # @param obj [Object]
107
107
  # @return [Void]
108
108
  def self.validate_raw(obj:)
109
- obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
109
+ obj.campaign_id&.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
110
110
  obj.monthly_volume&.is_a?(Pinnacle::Types::MessageVolumeEnum) != false || raise("Passed value for field obj.monthly_volume is not the expected type, validation failed.")
111
111
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
112
112
  obj.opt_in.nil? || Pinnacle::Types::UpsertTollFreeCampaignOptIn.validate_raw(obj: obj.opt_in)
@@ -12,7 +12,8 @@ module Pinnacle
12
12
  # These errors may request additional information or point out erroneous and/or
13
13
  # missing fields.
14
14
  attr_reader :error
15
- # @return [Integer] Id of the toll-free campaign.
15
+ # @return [String] The unique identifier of the toll-free campaign. This identifier is a string
16
+ # that always begins with the prefix `tf_`, for example: `tf_1234567890`.
16
17
  attr_reader :id
17
18
  # @return [Pinnacle::Types::GetTollFreeCampaignStatusResponseUpdates] Status of phone numbers that are being attached to this campaign. <br>
18
19
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
@@ -29,7 +30,8 @@ module Pinnacle
29
30
  # @param error [String] Summary of errors related to the verification process. <br>
30
31
  # These errors may request additional information or point out erroneous and/or
31
32
  # missing fields.
32
- # @param id [Integer] Id of the toll-free campaign.
33
+ # @param id [String] The unique identifier of the toll-free campaign. This identifier is a string
34
+ # that always begins with the prefix `tf_`, for example: `tf_1234567890`.
33
35
  # @param updates [Pinnacle::Types::GetTollFreeCampaignStatusResponseUpdates] Status of phone numbers that are being attached to this campaign. <br>
34
36
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
35
37
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
@@ -83,7 +85,7 @@ module Pinnacle
83
85
  # @return [Void]
84
86
  def self.validate_raw(obj:)
85
87
  obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
86
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id 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.")
87
89
  Pinnacle::Types::GetTollFreeCampaignStatusResponseUpdates.validate_raw(obj: obj.updates)
88
90
  end
89
91
  end
@@ -17,11 +17,10 @@ module Pinnacle
17
17
  # `INCOMPLETE`: Has not been submitted.<br>
18
18
  # `PENDING`: Currently being reviewed.<br>
19
19
  # `VERIFIED`: Verified and good to go.<br>
20
- # `UNVERIFIED`: No longer verified due to an update in the brand details.<br>
21
20
  # `VETTED`: Brand has been vetted by an external provider and has received vetting
22
21
  # scores.
23
22
  attr_reader :status
24
- # @return [Integer] Unique identifier for the campaign.
23
+ # @return [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
25
24
  attr_reader :campaign_id
26
25
  # @return [Pinnacle::Types::MessageVolumeEnum]
27
26
  attr_reader :monthly_volume
@@ -46,10 +45,9 @@ module Pinnacle
46
45
  # `INCOMPLETE`: Has not been submitted.<br>
47
46
  # `PENDING`: Currently being reviewed.<br>
48
47
  # `VERIFIED`: Verified and good to go.<br>
49
- # `UNVERIFIED`: No longer verified due to an update in the brand details.<br>
50
48
  # `VETTED`: Brand has been vetted by an external provider and has received vetting
51
49
  # scores.
52
- # @param campaign_id [Integer] Unique identifier for the campaign.
50
+ # @param campaign_id [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
53
51
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
54
52
  # @param name [String] Display name of the campaign.
55
53
  # @param opt_in [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
@@ -143,7 +141,7 @@ module Pinnacle
143
141
  def self.validate_raw(obj:)
144
142
  Pinnacle::Types::ExtendedBrand.validate_raw(obj: obj.brand)
145
143
  obj.status.is_a?(Pinnacle::Types::ProfileStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
146
- obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
144
+ obj.campaign_id&.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
147
145
  obj.monthly_volume&.is_a?(Pinnacle::Types::MessageVolumeEnum) != false || raise("Passed value for field obj.monthly_volume is not the expected type, validation failed.")
148
146
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
149
147
  obj.opt_in.nil? || Pinnacle::Types::UpsertTollFreeCampaignOptIn.validate_raw(obj: obj.opt_in)
@@ -6,7 +6,8 @@ require "json"
6
6
  module Pinnacle
7
7
  module Types
8
8
  class UpdatedContactId
9
- # @return [Integer] Unique ID of the updated contact.
9
+ # @return [String] Unique ID of the updated contact. This identifier is a string that always begins
10
+ # with the prefix `co_`, for example: `co_1234567890`.
10
11
  attr_reader :id
11
12
  # @return [OpenStruct] Additional properties unmapped to the current class definition
12
13
  attr_reader :additional_properties
@@ -16,7 +17,8 @@ module Pinnacle
16
17
 
17
18
  OMIT = Object.new
18
19
 
19
- # @param id [Integer] Unique ID of the updated contact.
20
+ # @param id [String] Unique ID of the updated contact. This identifier is a string that always begins
21
+ # with the prefix `co_`, for example: `co_1234567890`.
20
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
23
  # @return [Pinnacle::Types::UpdatedContactId]
22
24
  def initialize(id:, additional_properties: nil)
@@ -50,7 +52,7 @@ module Pinnacle
50
52
  # @param obj [Object]
51
53
  # @return [Void]
52
54
  def self.validate_raw(obj:)
53
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
55
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
54
56
  end
55
57
  end
56
58
  end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "user_event_conversation"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Types
9
+ # Represents an event triggered by a user such as when they start typing.
10
+ class UserEvent
11
+ # @return [String] Type of user event.
12
+ attr_reader :type
13
+ # @return [String] Timestamp when the user event started in ISO 8601 format.
14
+ attr_reader :started_at
15
+ # @return [Pinnacle::Types::UserEventConversation] Conversation metadata containing the conversation ID, sender, and recipient
16
+ # information.
17
+ attr_reader :conversation
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param type [String] Type of user event.
27
+ # @param started_at [String] Timestamp when the user event started in ISO 8601 format.
28
+ # @param conversation [Pinnacle::Types::UserEventConversation] Conversation metadata containing the conversation ID, sender, and recipient
29
+ # information.
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [Pinnacle::Types::UserEvent]
32
+ def initialize(type:, started_at:, conversation:, additional_properties: nil)
33
+ @type = type
34
+ @started_at = started_at
35
+ @conversation = conversation
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "type": type, "startedAt": started_at, "conversation": conversation }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of UserEvent
41
+ #
42
+ # @param json_object [String]
43
+ # @return [Pinnacle::Types::UserEvent]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ type = parsed_json["type"]
48
+ started_at = parsed_json["startedAt"]
49
+ if parsed_json["conversation"].nil?
50
+ conversation = nil
51
+ else
52
+ conversation = parsed_json["conversation"].to_json
53
+ conversation = Pinnacle::Types::UserEventConversation.from_json(json_object: conversation)
54
+ end
55
+ new(
56
+ type: type,
57
+ started_at: started_at,
58
+ conversation: conversation,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of UserEvent to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
78
+ obj.started_at.is_a?(String) != false || raise("Passed value for field obj.started_at is not the expected type, validation failed.")
79
+ Pinnacle::Types::UserEventConversation.validate_raw(obj: obj.conversation)
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ # Conversation metadata containing the conversation ID, sender, and recipient
9
+ # information.
10
+ class UserEventConversation
11
+ # @return [Integer] Unique identifier for the conversation. To get more conversation details, use
12
+ # the [POST /conversations/get](/api-reference/conversations/get) endpoint.
13
+ attr_reader :id
14
+ # @return [String] Phone number of the user who triggered the event.
15
+ attr_reader :from
16
+ # @return [String] Agent ID that the user is interacting with.
17
+ attr_reader :to
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param id [Integer] Unique identifier for the conversation. To get more conversation details, use
27
+ # the [POST /conversations/get](/api-reference/conversations/get) endpoint.
28
+ # @param from [String] Phone number of the user who triggered the event.
29
+ # @param to [String] Agent ID that the user is interacting with.
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [Pinnacle::Types::UserEventConversation]
32
+ def initialize(id:, from:, to:, additional_properties: nil)
33
+ @id = id
34
+ @from = from
35
+ @to = to
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "id": id, "from": from, "to": to }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of UserEventConversation
41
+ #
42
+ # @param json_object [String]
43
+ # @return [Pinnacle::Types::UserEventConversation]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ id = parsed_json["id"]
48
+ from = parsed_json["from"]
49
+ to = parsed_json["to"]
50
+ new(
51
+ id: id,
52
+ from: from,
53
+ to: to,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+
58
+ # Serialize an instance of UserEventConversation to a JSON object
59
+ #
60
+ # @return [String]
61
+ def to_json(*_args)
62
+ @_field_set&.to_json
63
+ end
64
+
65
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
66
+ # hash and check each fields type against the current object's property
67
+ # definitions.
68
+ #
69
+ # @param obj [Object]
70
+ # @return [Void]
71
+ def self.validate_raw(obj:)
72
+ obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
73
+ obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
74
+ obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
75
+ end
76
+ end
77
+ end
78
+ end
@@ -17,7 +17,8 @@ module Pinnacle
17
17
  attr_reader :file
18
18
  # @return [String] ISO 8601 timestamp of last vCard update.
19
19
  attr_reader :revision
20
- # @return [Integer] Unique identifier for the contact.
20
+ # @return [String] The unique identifier of the contact. This identifier is a string that always
21
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
21
22
  attr_reader :id
22
23
  # @return [String] Full display name for the vCard.
23
24
  attr_reader :formatted_name
@@ -59,7 +60,8 @@ module Pinnacle
59
60
 
60
61
  # @param file [Pinnacle::Types::VCardDataFile] File associated to the contact.
61
62
  # @param revision [String] ISO 8601 timestamp of last vCard update.
62
- # @param id [Integer] Unique identifier for the contact.
63
+ # @param id [String] The unique identifier of the contact. This identifier is a string that always
64
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
63
65
  # @param formatted_name [String] Full display name for the vCard.
64
66
  # @param name [Pinnacle::Types::VCardName] Structured name components.
65
67
  # @param nickname [Array<String>] Nicknames or aliases.
@@ -215,7 +217,7 @@ module Pinnacle
215
217
  def self.validate_raw(obj:)
216
218
  Pinnacle::Types::VCardDataFile.validate_raw(obj: obj.file)
217
219
  obj.revision&.is_a?(String) != false || raise("Passed value for field obj.revision is not the expected type, validation failed.")
218
- obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
220
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
219
221
  obj.formatted_name&.is_a?(String) != false || raise("Passed value for field obj.formatted_name is not the expected type, validation failed.")
220
222
  obj.name.nil? || Pinnacle::Types::VCardName.validate_raw(obj: obj.name)
221
223
  obj.nickname&.is_a?(Array) != false || raise("Passed value for field obj.nickname is not the expected type, validation failed.")
@@ -8,7 +8,13 @@ module Pinnacle
8
8
  class ValidateCampaignParams
9
9
  # @return [String] Any additional information you want to provide.
10
10
  attr_reader :additional_info
11
- # @return [Integer] Campaign ID.
11
+ # @return [String] Unique identifier for the campaign.
12
+ # - When validating 10DLC campaigns, it must begin with the prefix `dlc_` (e.g.,
13
+ # `dlc_1234567890`)
14
+ # - When validating toll-free campaigns, it must begin with the prefix `tf_`
15
+ # (e.g., `tf_1234567890`)
16
+ # - When validating RCS campaigns, it must begin with the prefix `rcs_` (e.g.,
17
+ # `rcs_1234567890`)
12
18
  attr_reader :campaign_id
13
19
  # @return [OpenStruct] Additional properties unmapped to the current class definition
14
20
  attr_reader :additional_properties
@@ -19,7 +25,13 @@ module Pinnacle
19
25
  OMIT = Object.new
20
26
 
21
27
  # @param additional_info [String] Any additional information you want to provide.
22
- # @param campaign_id [Integer] Campaign ID.
28
+ # @param campaign_id [String] Unique identifier for the campaign.
29
+ # - When validating 10DLC campaigns, it must begin with the prefix `dlc_` (e.g.,
30
+ # `dlc_1234567890`)
31
+ # - When validating toll-free campaigns, it must begin with the prefix `tf_`
32
+ # (e.g., `tf_1234567890`)
33
+ # - When validating RCS campaigns, it must begin with the prefix `rcs_` (e.g.,
34
+ # `rcs_1234567890`)
23
35
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
36
  # @return [Pinnacle::Types::ValidateCampaignParams]
25
37
  def initialize(campaign_id:, additional_info: OMIT, additional_properties: nil)
@@ -62,7 +74,7 @@ module Pinnacle
62
74
  # @return [Void]
63
75
  def self.validate_raw(obj:)
64
76
  obj.additional_info&.is_a?(String) != false || raise("Passed value for field obj.additional_info is not the expected type, validation failed.")
65
- obj.campaign_id.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
77
+ obj.campaign_id.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
66
78
  end
67
79
  end
68
80
  end
@@ -12,7 +12,8 @@ require "json"
12
12
  module Pinnacle
13
13
  module Types
14
14
  class Vcard
15
- # @return [Integer] Unique identifier for the contact.
15
+ # @return [String] The unique identifier of the contact. This identifier is a string that always
16
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
16
17
  attr_reader :id
17
18
  # @return [String] Full display name for the vCard.
18
19
  attr_reader :formatted_name
@@ -52,7 +53,8 @@ module Pinnacle
52
53
 
53
54
  OMIT = Object.new
54
55
 
55
- # @param id [Integer] Unique identifier for the contact.
56
+ # @param id [String] The unique identifier of the contact. This identifier is a string that always
57
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
56
58
  # @param formatted_name [String] Full display name for the vCard.
57
59
  # @param name [Pinnacle::Types::VCardName] Structured name components.
58
60
  # @param nickname [Array<String>] Nicknames or aliases.
@@ -193,7 +195,7 @@ module Pinnacle
193
195
  # @param obj [Object]
194
196
  # @return [Void]
195
197
  def self.validate_raw(obj:)
196
- obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
198
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
197
199
  obj.formatted_name&.is_a?(String) != false || raise("Passed value for field obj.formatted_name is not the expected type, validation failed.")
198
200
  obj.name.nil? || Pinnacle::Types::VCardName.validate_raw(obj: obj.name)
199
201
  obj.nickname&.is_a?(Array) != false || raise("Passed value for field obj.nickname is not the expected type, validation failed.")
@@ -14,7 +14,8 @@ module Pinnacle
14
14
  class VcardContent
15
15
  # @return [String] ISO 8601 timestamp of last vCard update.
16
16
  attr_reader :revision
17
- # @return [Integer] Unique identifier for the contact.
17
+ # @return [String] The unique identifier of the contact. This identifier is a string that always
18
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
18
19
  attr_reader :id
19
20
  # @return [String] Full display name for the vCard.
20
21
  attr_reader :formatted_name
@@ -55,7 +56,8 @@ module Pinnacle
55
56
  OMIT = Object.new
56
57
 
57
58
  # @param revision [String] ISO 8601 timestamp of last vCard update.
58
- # @param id [Integer] Unique identifier for the contact.
59
+ # @param id [String] The unique identifier of the contact. This identifier is a string that always
60
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
59
61
  # @param formatted_name [String] Full display name for the vCard.
60
62
  # @param name [Pinnacle::Types::VCardName] Structured name components.
61
63
  # @param nickname [Array<String>] Nicknames or aliases.
@@ -201,7 +203,7 @@ module Pinnacle
201
203
  # @return [Void]
202
204
  def self.validate_raw(obj:)
203
205
  obj.revision&.is_a?(String) != false || raise("Passed value for field obj.revision is not the expected type, validation failed.")
204
- obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
206
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
205
207
  obj.formatted_name&.is_a?(String) != false || raise("Passed value for field obj.formatted_name is not the expected type, validation failed.")
206
208
  obj.name.nil? || Pinnacle::Types::VCardName.validate_raw(obj: obj.name)
207
209
  obj.nickname&.is_a?(Array) != false || raise("Passed value for field obj.nickname is not the expected type, validation failed.")
@@ -6,7 +6,8 @@ require "json"
6
6
  module Pinnacle
7
7
  module Types
8
8
  class VcardResource
9
- # @return [Integer] Contact's id
9
+ # @return [String] The unique identifier of the contact. This identifier is a string that always
10
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
10
11
  attr_reader :id
11
12
  # @return [String] Presigned download url to download vCard data. <br>
12
13
  # This link will expire in one hour.
@@ -19,7 +20,8 @@ module Pinnacle
19
20
 
20
21
  OMIT = Object.new
21
22
 
22
- # @param id [Integer] Contact's id
23
+ # @param id [String] The unique identifier of the contact. This identifier is a string that always
24
+ # begins with the prefix `cc_`, for example: `cc_1234567890`.
23
25
  # @param download_url [String] Presigned download url to download vCard data. <br>
24
26
  # This link will expire in one hour.
25
27
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -63,7 +65,7 @@ module Pinnacle
63
65
  # @param obj [Object]
64
66
  # @return [Void]
65
67
  def self.validate_raw(obj:)
66
- obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
68
+ obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
67
69
  obj.download_url&.is_a?(String) != false || raise("Passed value for field obj.download_url is not the expected type, validation failed.")
68
70
  end
69
71
  end
@@ -5,6 +5,7 @@ module Pinnacle
5
5
  # Types of events that can trigger webhook notifications for phone numbers.
6
6
  # Subscribe to specific events to receive real-time updates about your phone
7
7
  # number activity.
8
+ # Use `null` to listen to all events.
8
9
  class WebhookEventEnum
9
10
  MESSAGE_STATUS = "MESSAGE.STATUS"
10
11
  MESSAGE_RECEIVED = "MESSAGE.RECEIVED"
@@ -9,7 +9,8 @@ module Pinnacle
9
9
  class Webhooks
10
10
  # @return [String] URL where webhook events are delivered.
11
11
  attr_reader :endpoint
12
- # @return [Integer] Unique identifier for the webhook.
12
+ # @return [String] The unique identifier of the webhook. This identifier is a string that always
13
+ # begins with the prefix `wh_`, for example: `wh_1234567890`.
13
14
  attr_reader :id
14
15
  # @return [String] Name of the webhook.
15
16
  attr_reader :name
@@ -22,7 +23,8 @@ module Pinnacle
22
23
  OMIT = Object.new
23
24
 
24
25
  # @param endpoint [String] URL where webhook events are delivered.
25
- # @param id [Integer] Unique identifier for the webhook.
26
+ # @param id [String] The unique identifier of the webhook. This identifier is a string that always
27
+ # begins with the prefix `wh_`, for example: `wh_1234567890`.
26
28
  # @param name [String] Name of the webhook.
27
29
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
30
  # @return [Pinnacle::Types::Webhooks]
@@ -67,7 +69,7 @@ module Pinnacle
67
69
  # @return [Void]
68
70
  def self.validate_raw(obj:)
69
71
  obj.endpoint.is_a?(String) != false || raise("Passed value for field obj.endpoint is not the expected type, validation failed.")
70
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
72
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
71
73
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
74
  end
73
75
  end