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
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "button_clicked_data_button"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Types
9
+ # Unified data structure for button click events.
10
+ class ButtonClickedData
11
+ # @return [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
12
+ attr_reader :button
13
+ # @return [String] ID of the message this button was sent in, or null if not available. To get the
14
+ # message details, use the [GET /messages/{id}](/api-reference/messages/get)
15
+ # endpoint.
16
+ attr_reader :message_id
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param button [Pinnacle::Types::ButtonClickedDataButton] Information about the button that was clicked.
26
+ # @param message_id [String] ID of the message this button was sent in, or null if not available. To get the
27
+ # message details, use the [GET /messages/{id}](/api-reference/messages/get)
28
+ # endpoint.
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [Pinnacle::Types::ButtonClickedData]
31
+ def initialize(button:, message_id: OMIT, additional_properties: nil)
32
+ @button = button
33
+ @message_id = message_id if message_id != OMIT
34
+ @additional_properties = additional_properties
35
+ @_field_set = { "button": button, "messageId": message_id }.reject do |_k, v|
36
+ v == OMIT
37
+ end
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of ButtonClickedData
41
+ #
42
+ # @param json_object [String]
43
+ # @return [Pinnacle::Types::ButtonClickedData]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ if parsed_json["button"].nil?
48
+ button = nil
49
+ else
50
+ button = parsed_json["button"].to_json
51
+ button = Pinnacle::Types::ButtonClickedDataButton.from_json(json_object: button)
52
+ end
53
+ message_id = parsed_json["messageId"]
54
+ new(
55
+ button: button,
56
+ message_id: message_id,
57
+ additional_properties: struct
58
+ )
59
+ end
60
+
61
+ # Serialize an instance of ButtonClickedData to a JSON object
62
+ #
63
+ # @return [String]
64
+ def to_json(*_args)
65
+ @_field_set&.to_json
66
+ end
67
+
68
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
69
+ # hash and check each fields type against the current object's property
70
+ # definitions.
71
+ #
72
+ # @param obj [Object]
73
+ # @return [Void]
74
+ def self.validate_raw(obj:)
75
+ Pinnacle::Types::ButtonClickedDataButton.validate_raw(obj: obj.button)
76
+ obj.message_id&.is_a?(String) != false || raise("Passed value for field obj.message_id is not the expected type, validation failed.")
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "button_clicked_data_button_type"
4
+ require_relative "button_clicked_data_button_raw"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Types
10
+ # Information about the button that was clicked.
11
+ class ButtonClickedDataButton
12
+ # @return [Pinnacle::Types::ButtonClickedDataButtonType] Type of button clicked.
13
+ # - `CARD` for card buttons,
14
+ # - `QUICK_REPLY` for quick replies.
15
+ # - `null` if we cannot determine the button type. This is a rare edge case and is
16
+ # mainly here for backward compatibility.
17
+ attr_reader :type
18
+ # @return [Pinnacle::Types::ButtonClickedDataButtonRaw] Raw button data. Contains the entire button that was clicked by the user. In
19
+ # rare cases where we cannot determine the exact button, this will return only the
20
+ # button title.
21
+ attr_reader :raw
22
+ # @return [String] Extracted payload from the button's `payload` field, if provided. Provides quick
23
+ # access to any payload that was attached to the button.
24
+ attr_reader :payload
25
+ # @return [String] Additional metadata attached to the button's `metadata` field, if provided.
26
+ attr_reader :metadata
27
+ # @return [Integer] Number of times the button has been clicked.
28
+ attr_reader :clicks
29
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
30
+ attr_reader :additional_properties
31
+ # @return [Object]
32
+ attr_reader :_field_set
33
+ protected :_field_set
34
+
35
+ OMIT = Object.new
36
+
37
+ # @param type [Pinnacle::Types::ButtonClickedDataButtonType] Type of button clicked.
38
+ # - `CARD` for card buttons,
39
+ # - `QUICK_REPLY` for quick replies.
40
+ # - `null` if we cannot determine the button type. This is a rare edge case and is
41
+ # mainly here for backward compatibility.
42
+ # @param raw [Pinnacle::Types::ButtonClickedDataButtonRaw] Raw button data. Contains the entire button that was clicked by the user. In
43
+ # rare cases where we cannot determine the exact button, this will return only the
44
+ # button title.
45
+ # @param payload [String] Extracted payload from the button's `payload` field, if provided. Provides quick
46
+ # access to any payload that was attached to the button.
47
+ # @param metadata [String] Additional metadata attached to the button's `metadata` field, if provided.
48
+ # @param clicks [Integer] Number of times the button has been clicked.
49
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
50
+ # @return [Pinnacle::Types::ButtonClickedDataButton]
51
+ def initialize(raw:, clicks:, type: OMIT, payload: OMIT, metadata: OMIT, additional_properties: nil)
52
+ @type = type if type != OMIT
53
+ @raw = raw
54
+ @payload = payload if payload != OMIT
55
+ @metadata = metadata if metadata != OMIT
56
+ @clicks = clicks
57
+ @additional_properties = additional_properties
58
+ @_field_set = {
59
+ "type": type,
60
+ "raw": raw,
61
+ "payload": payload,
62
+ "metadata": metadata,
63
+ "clicks": clicks
64
+ }.reject do |_k, v|
65
+ v == OMIT
66
+ end
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of ButtonClickedDataButton
70
+ #
71
+ # @param json_object [String]
72
+ # @return [Pinnacle::Types::ButtonClickedDataButton]
73
+ def self.from_json(json_object:)
74
+ struct = JSON.parse(json_object, object_class: OpenStruct)
75
+ parsed_json = JSON.parse(json_object)
76
+ type = parsed_json["type"]
77
+ if parsed_json["raw"].nil?
78
+ raw = nil
79
+ else
80
+ raw = parsed_json["raw"].to_json
81
+ raw = Pinnacle::Types::ButtonClickedDataButtonRaw.from_json(json_object: raw)
82
+ end
83
+ payload = parsed_json["payload"]
84
+ metadata = parsed_json["metadata"]
85
+ clicks = parsed_json["clicks"]
86
+ new(
87
+ type: type,
88
+ raw: raw,
89
+ payload: payload,
90
+ metadata: metadata,
91
+ clicks: clicks,
92
+ additional_properties: struct
93
+ )
94
+ end
95
+
96
+ # Serialize an instance of ButtonClickedDataButton to a JSON object
97
+ #
98
+ # @return [String]
99
+ def to_json(*_args)
100
+ @_field_set&.to_json
101
+ end
102
+
103
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
104
+ # hash and check each fields type against the current object's property
105
+ # definitions.
106
+ #
107
+ # @param obj [Object]
108
+ # @return [Void]
109
+ def self.validate_raw(obj:)
110
+ obj.type&.is_a?(Pinnacle::Types::ButtonClickedDataButtonType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
111
+ Pinnacle::Types::ButtonClickedDataButtonRaw.validate_raw(obj: obj.raw)
112
+ obj.payload&.is_a?(String) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.")
113
+ obj.metadata&.is_a?(String) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
114
+ obj.clicks.is_a?(Integer) != false || raise("Passed value for field obj.clicks is not the expected type, validation failed.")
115
+ end
116
+ end
117
+ end
118
+ end
@@ -1,21 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
- require_relative "click_action_data_metadata"
4
+ require_relative "rich_button"
5
5
 
6
6
  module Pinnacle
7
7
  module Types
8
- # Payload received from the button interaction.
9
- class ClickActionData
10
- # Deserialize a JSON object to an instance of ClickActionData
8
+ # Raw button data. Contains the entire button that was clicked by the user. In
9
+ # rare cases where we cannot determine the exact button, this will return only the
10
+ # button title.
11
+ class ButtonClickedDataButtonRaw
12
+ # Deserialize a JSON object to an instance of ButtonClickedDataButtonRaw
11
13
  #
12
14
  # @param json_object [String]
13
- # @return [Pinnacle::Types::ClickActionData]
15
+ # @return [Pinnacle::Types::ButtonClickedDataButtonRaw]
14
16
  def self.from_json(json_object:)
15
17
  struct = JSON.parse(json_object, object_class: OpenStruct)
16
18
  begin
17
- Pinnacle::Types::ClickActionDataMetadata.validate_raw(obj: struct)
18
- return Pinnacle::Types::ClickActionDataMetadata.from_json(json_object: struct) unless struct.nil?
19
+ Pinnacle::Types::RichButton.validate_raw(obj: struct)
20
+ return Pinnacle::Types::RichButton.from_json(json_object: struct) unless struct.nil?
19
21
 
20
22
  return nil
21
23
  rescue StandardError
@@ -40,7 +42,7 @@ module Pinnacle
40
42
  # @return [Void]
41
43
  def self.validate_raw(obj:)
42
44
  begin
43
- return Pinnacle::Types::ClickActionDataMetadata.validate_raw(obj: obj)
45
+ return Pinnacle::Types::RichButton.validate_raw(obj: obj)
44
46
  rescue StandardError
45
47
  # noop
46
48
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Type of button clicked.
6
+ # - `CARD` for card buttons,
7
+ # - `QUICK_REPLY` for quick replies.
8
+ # - `null` if we cannot determine the button type. This is a rare edge case and is
9
+ # mainly here for backward compatibility.
10
+ class ButtonClickedDataButtonType
11
+ CARD = "CARD"
12
+ QUICK_REPLY = "QUICK_REPLY"
13
+ end
14
+ end
15
+ end
@@ -8,7 +8,11 @@ module Pinnacle
8
8
  module Types
9
9
  # Information about the campaign associated with a conversation
10
10
  class CampaignQuery
11
- # @return [String] Unique identifier for the campaign
11
+ # @return [String] Unique identifier for the campaign. This identifier is a string that begins with
12
+ # the prefix:
13
+ # - TOLL_FREE: `tf_` (e.g., `tf_1234567890`)
14
+ # - 10DLC: `dlc_` (e.g., `dlc_1234567890`)
15
+ # - RCS: `rcs_` (e.g., `rcs_1234567890`)
12
16
  attr_reader :id
13
17
  # @return [Pinnacle::Types::CampaignEnum]
14
18
  attr_reader :type
@@ -20,7 +24,11 @@ module Pinnacle
20
24
 
21
25
  OMIT = Object.new
22
26
 
23
- # @param id [String] Unique identifier for the campaign
27
+ # @param id [String] Unique identifier for the campaign. This identifier is a string that begins with
28
+ # the prefix:
29
+ # - TOLL_FREE: `tf_` (e.g., `tf_1234567890`)
30
+ # - 10DLC: `dlc_` (e.g., `dlc_1234567890`)
31
+ # - RCS: `rcs_` (e.g., `rcs_1234567890`)
24
32
  # @param type [Pinnacle::Types::CampaignEnum]
25
33
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
34
  # @return [Pinnacle::Types::CampaignQuery]
@@ -10,7 +10,8 @@ module Pinnacle
10
10
  attr_reader :description
11
11
  # @return [String] Contact's email address, if available.
12
12
  attr_reader :email
13
- # @return [Integer] Unique ID of the contact.
13
+ # @return [String] Unique ID of the contact. This identifier is a string that always begins with
14
+ # the prefix `co_`, for example: `co_1234567890`.
14
15
  attr_reader :id
15
16
  # @return [String] Full name of the contact, if available.
16
17
  attr_reader :name
@@ -28,7 +29,8 @@ module Pinnacle
28
29
 
29
30
  # @param description [String] Additional information about the contact.
30
31
  # @param email [String] Contact's email address, if available.
31
- # @param id [Integer] Unique ID of the contact.
32
+ # @param id [String] Unique ID of the contact. This identifier is a string that always begins with
33
+ # the prefix `co_`, for example: `co_1234567890`.
32
34
  # @param name [String] Full name of the contact, if available.
33
35
  # @param phone_number [String] Contact's phone number in E.164 format.
34
36
  # @param tags [Array<String>] List of tags associated with the contact.
@@ -95,7 +97,7 @@ module Pinnacle
95
97
  def self.validate_raw(obj:)
96
98
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
97
99
  obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
98
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
100
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
99
101
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
100
102
  obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
101
103
  obj.tags&.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
@@ -6,7 +6,8 @@ require "json"
6
6
  module Pinnacle
7
7
  module Types
8
8
  class ContactId
9
- # @return [Integer] Unique ID of the created contact.
9
+ # @return [String] Unique ID of the created contact. This identifier is a string that always begins
10
+ # with the prefix `co_`, for example: `co_1234567890`.
10
11
  attr_reader :id
11
12
  # @return [OpenStruct] Additional properties unmapped to the current class definition
12
13
  attr_reader :additional_properties
@@ -16,7 +17,8 @@ module Pinnacle
16
17
 
17
18
  OMIT = Object.new
18
19
 
19
- # @param id [Integer] Unique ID of the created contact.
20
+ # @param id [String] Unique ID of the created contact. This identifier is a string that always begins
21
+ # with the prefix `co_`, for example: `co_1234567890`.
20
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
23
  # @return [Pinnacle::Types::ContactId]
22
24
  def initialize(id:, additional_properties: nil)
@@ -50,7 +52,7 @@ module Pinnacle
50
52
  # @param obj [Object]
51
53
  # @return [Void]
52
54
  def self.validate_raw(obj:)
53
- obj.id.is_a?(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
@@ -10,15 +10,19 @@ module Pinnacle
10
10
  module Types
11
11
  # Conversation that was found.
12
12
  class Conversation
13
- # @return [Integer] Identifier for the brand associated with this conversation.
13
+ # @return [String] The unique identifier of the brand associated with this conversation. This
14
+ # identifier is a string that always begins with the prefix `b_`, for example:
15
+ # `b_1234567890`.
14
16
  attr_reader :brand_id
15
- # @return [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign.
17
+ # @return [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign. This
18
+ # is an object that contains the campaign ID and type.
16
19
  attr_reader :campaign
17
20
  # @return [Pinnacle::Types::ConversationContact] Contact information for the recipient in a conversation.
18
21
  attr_reader :contact
19
22
  # @return [String] ISO 8601 timestamp when the conversation was created.
20
23
  attr_reader :created_at
21
- # @return [Integer] Unique identifier for the conversation.
24
+ # @return [String] Unique identifier for the conversation. This identifier is a string that always
25
+ # begins with the prefix `conv_`, for example: `conv_1234567890`.
22
26
  attr_reader :id
23
27
  # @return [String] Free-form notes or comments about the conversation.
24
28
  attr_reader :notes
@@ -37,11 +41,15 @@ module Pinnacle
37
41
 
38
42
  OMIT = Object.new
39
43
 
40
- # @param brand_id [Integer] Identifier for the brand associated with this conversation.
41
- # @param campaign [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign.
44
+ # @param brand_id [String] The unique identifier of the brand associated with this conversation. This
45
+ # identifier is a string that always begins with the prefix `b_`, for example:
46
+ # `b_1234567890`.
47
+ # @param campaign [Pinnacle::Types::CampaignQuery] Campaign information if this conversation is part of a marketing campaign. This
48
+ # is an object that contains the campaign ID and type.
42
49
  # @param contact [Pinnacle::Types::ConversationContact] Contact information for the recipient in a conversation.
43
50
  # @param created_at [String] ISO 8601 timestamp when the conversation was created.
44
- # @param id [Integer] Unique identifier for the conversation.
51
+ # @param id [String] Unique identifier for the conversation. This identifier is a string that always
52
+ # begins with the prefix `conv_`, for example: `conv_1234567890`.
45
53
  # @param notes [String] Free-form notes or comments about the conversation.
46
54
  # @param sender [Pinnacle::Types::ConversationSender] The sender of messages in this conversation. Can be:
47
55
  # - A phone number with its capabilities and metadata
@@ -132,11 +140,11 @@ module Pinnacle
132
140
  # @param obj [Object]
133
141
  # @return [Void]
134
142
  def self.validate_raw(obj:)
135
- obj.brand_id&.is_a?(Integer) != false || raise("Passed value for field obj.brand_id is not the expected type, validation failed.")
143
+ obj.brand_id&.is_a?(String) != false || raise("Passed value for field obj.brand_id is not the expected type, validation failed.")
136
144
  obj.campaign.nil? || Pinnacle::Types::CampaignQuery.validate_raw(obj: obj.campaign)
137
145
  Pinnacle::Types::ConversationContact.validate_raw(obj: obj.contact)
138
146
  obj.created_at.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
139
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
147
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
140
148
  obj.notes.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
141
149
  obj.sender.nil? || Pinnacle::Types::ConversationSender.validate_raw(obj: obj.sender)
142
150
  obj.updated_at.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
@@ -7,7 +7,9 @@ module Pinnacle
7
7
  module Types
8
8
  # Retrieve conversation information by ID.
9
9
  class ConversationByIdParams
10
- # @return [Integer] Unique identifier of the conversation you want to retrieve.
10
+ # @return [String] Unique identifier of the conversation you want to retrieve. This identifier is a
11
+ # string that always begins with the prefix `conv_`, for example:
12
+ # `conv_1234567890`.
11
13
  attr_reader :id
12
14
  # @return [OpenStruct] Additional properties unmapped to the current class definition
13
15
  attr_reader :additional_properties
@@ -17,7 +19,9 @@ module Pinnacle
17
19
 
18
20
  OMIT = Object.new
19
21
 
20
- # @param id [Integer] Unique identifier of the conversation you want to retrieve.
22
+ # @param id [String] Unique identifier of the conversation you want to retrieve. This identifier is a
23
+ # string that always begins with the prefix `conv_`, for example:
24
+ # `conv_1234567890`.
21
25
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
22
26
  # @return [Pinnacle::Types::ConversationByIdParams]
23
27
  def initialize(id:, additional_properties: nil)
@@ -51,7 +55,7 @@ module Pinnacle
51
55
  # @param obj [Object]
52
56
  # @return [Void]
53
57
  def self.validate_raw(obj:)
54
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
58
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
55
59
  end
56
60
  end
57
61
  end
@@ -7,7 +7,8 @@ module Pinnacle
7
7
  module Types
8
8
  # Contact information for the recipient in a conversation.
9
9
  class ConversationContact
10
- # @return [Integer] Unique identifier for the contact.
10
+ # @return [String] Unique ID of the contact. This identifier is a string that always begins with
11
+ # the prefix `co_`, for example: `co_1234567890`.
11
12
  attr_reader :id
12
13
  # @return [String] The contact's phone number in E.164 format.
13
14
  attr_reader :phone_number
@@ -19,7 +20,8 @@ module Pinnacle
19
20
 
20
21
  OMIT = Object.new
21
22
 
22
- # @param id [Integer] Unique identifier for the contact.
23
+ # @param id [String] Unique ID of the contact. This identifier is a string that always begins with
24
+ # the prefix `co_`, for example: `co_1234567890`.
23
25
  # @param phone_number [String] The contact's phone number in E.164 format.
24
26
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
27
  # @return [Pinnacle::Types::ConversationContact]
@@ -60,7 +62,7 @@ module Pinnacle
60
62
  # @param obj [Object]
61
63
  # @return [Void]
62
64
  def self.validate_raw(obj:)
63
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
65
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
64
66
  obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
65
67
  end
66
68
  end
@@ -7,7 +7,8 @@ module Pinnacle
7
7
  module Types
8
8
  class CreateUrlOptions
9
9
  # @return [String] Expiration date in ISO 8601 format for the shortened URL. <br>
10
- # If omitted, then a permalink is generated instead.
10
+ # If omitted, then a permalink is generated instead. Short permalinks contain a
11
+ # 30-digit link id. Short links with an expiration date contain a 8-digit link id.
11
12
  attr_reader :expires_at
12
13
  # @return [OpenStruct] Additional properties unmapped to the current class definition
13
14
  attr_reader :additional_properties
@@ -18,7 +19,8 @@ module Pinnacle
18
19
  OMIT = Object.new
19
20
 
20
21
  # @param expires_at [String] Expiration date in ISO 8601 format for the shortened URL. <br>
21
- # If omitted, then a permalink is generated instead.
22
+ # If omitted, then a permalink is generated instead. Short permalinks contain a
23
+ # 30-digit link id. Short links with an expiration date contain a 8-digit link id.
22
24
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
25
  # @return [Pinnacle::Types::CreateUrlOptions]
24
26
  def initialize(expires_at: OMIT, additional_properties: nil)
@@ -8,7 +8,8 @@ module Pinnacle
8
8
  class DetachedWebhookInfo
9
9
  # @return [String] Confirmation message.
10
10
  attr_reader :message
11
- # @return [Integer] ID of the detached webhook.
11
+ # @return [String] Unique identifier of the webhook within the account. This identifier is a string
12
+ # that always begins with the prefix `wh_`, for example: `wh_1234567890`.
12
13
  attr_reader :webhook_id
13
14
  # @return [String] Phone number the webhook was detached from in E.164 format.
14
15
  attr_reader :phone_number
@@ -21,7 +22,8 @@ module Pinnacle
21
22
  OMIT = Object.new
22
23
 
23
24
  # @param message [String] Confirmation message.
24
- # @param webhook_id [Integer] ID of the detached webhook.
25
+ # @param webhook_id [String] Unique identifier of the webhook within the account. This identifier is a string
26
+ # that always begins with the prefix `wh_`, for example: `wh_1234567890`.
25
27
  # @param phone_number [String] Phone number the webhook was detached from in E.164 format.
26
28
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
29
  # @return [Pinnacle::Types::DetachedWebhookInfo]
@@ -66,7 +68,7 @@ module Pinnacle
66
68
  # @return [Void]
67
69
  def self.validate_raw(obj:)
68
70
  obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
69
- obj.webhook_id.is_a?(Integer) != false || raise("Passed value for field obj.webhook_id is not the expected type, validation failed.")
71
+ obj.webhook_id.is_a?(String) != false || raise("Passed value for field obj.webhook_id is not the expected type, validation failed.")
70
72
  obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
71
73
  end
72
74
  end
@@ -13,7 +13,8 @@ module Pinnacle
13
13
  # These errors may request additional information or point out erroneous and/or
14
14
  # missing fields.
15
15
  attr_reader :error
16
- # @return [Integer] Id of the DLC campaign.
16
+ # @return [String] The unique identifier of the 10DLC campaign. This identifier is a string that
17
+ # always begins with the prefix `dlc_`, for example: `dlc_1234567890`.
17
18
  attr_reader :id
18
19
  # @return [Pinnacle::Types::ProfileStatusEnum] Current review status of the DLC campaign. <br>
19
20
  # `INCOMPLETE`: Not submitted.<br>
@@ -22,7 +23,7 @@ module Pinnacle
22
23
  # `FAILED`: Issues and errors related to the campaign's details. See
23
24
  # [error](dlc-campaign#response.body.error) for these potential issues.
24
25
  attr_reader :status
25
- # @return [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of toll free numbers that are being attached to this campaign. <br>
26
+ # @return [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of local long code numbers that are being attached to this campaign. <br>
26
27
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
27
28
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
28
29
  attr_reader :updates
@@ -37,14 +38,15 @@ module Pinnacle
37
38
  # @param error [String] Summary of errors related to the verification process. <br>
38
39
  # These errors may request additional information or point out erroneous and/or
39
40
  # missing fields.
40
- # @param id [Integer] Id of the DLC campaign.
41
+ # @param id [String] The unique identifier of the 10DLC campaign. This identifier is a string that
42
+ # always begins with the prefix `dlc_`, for example: `dlc_1234567890`.
41
43
  # @param status [Pinnacle::Types::ProfileStatusEnum] Current review status of the DLC campaign. <br>
42
44
  # `INCOMPLETE`: Not submitted.<br>
43
45
  # `IN REVIEW`: Being reviewed by carriers.<br>
44
46
  # `VERIFIED`: Approved and ready to send messages.<br>
45
47
  # `FAILED`: Issues and errors related to the campaign's details. See
46
48
  # [error](dlc-campaign#response.body.error) for these potential issues.
47
- # @param updates [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of toll free numbers that are being attached to this campaign. <br>
49
+ # @param updates [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of local long code numbers that are being attached to this campaign. <br>
48
50
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
49
51
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
50
52
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -98,7 +100,7 @@ module Pinnacle
98
100
  # @return [Void]
99
101
  def self.validate_raw(obj:)
100
102
  obj.error.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
101
- obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
103
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
102
104
  obj.status.is_a?(Pinnacle::Types::ProfileStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
103
105
  Pinnacle::Types::GetDlcCampaignStatusResponseUpdates.validate_raw(obj: obj.updates)
104
106
  end
@@ -17,7 +17,8 @@ module Pinnacle
17
17
  attr_reader :auto_renew
18
18
  # @return [Pinnacle::Types::ExtendedBrand] Brand associated with this campaign.
19
19
  attr_reader :brand
20
- # @return [Integer] Unique identifier for the campaign.
20
+ # @return [String] Unique identifier for the campaign. This identifier is a string that always
21
+ # begins with the prefix `dlc_`, for example: `dlc_1234567890`.
21
22
  attr_reader :campaign_id
22
23
  # @return [String] Description of the campaign.
23
24
  attr_reader :description
@@ -33,11 +34,11 @@ module Pinnacle
33
34
  attr_reader :options
34
35
  # @return [Array<String>] Example messages for the campaign.
35
36
  attr_reader :sample_messages
36
- # @return [Pinnacle::Types::ProfileStatusEnum] Current review status of the campaign.<br>
37
- # `INCOMPLETE`: Not submitted.<br>
38
- # `IN REVIEW`: Being reviewed by carriers.<br>
39
- # `VERIFIED`: Approved and ready to send messages.<br>
40
- # `FAILED`: Issues and errors related to the campaign's details.<br>
37
+ # @return [Pinnacle::Types::ProfileStatusEnum] Current review status of the campaign. <br>
38
+ # `INCOMPLETE`: Not submitted. <br>
39
+ # `IN REVIEW`: Being reviewed by carriers. <br>
40
+ # `VERIFIED`: Approved and ready to send messages. <br>
41
+ # `FAILED`: Issues and errors related to the campaign's details.
41
42
  attr_reader :status
42
43
  # @return [Pinnacle::Types::DlcWithExtendedBrandAndStatusUseCase] Use case for the campaign.
43
44
  attr_reader :use_case
@@ -51,7 +52,8 @@ module Pinnacle
51
52
 
52
53
  # @param auto_renew [Boolean] Whether the campaign renews automatically.
53
54
  # @param brand [Pinnacle::Types::ExtendedBrand] Brand associated with this campaign.
54
- # @param campaign_id [Integer] Unique identifier for the campaign.
55
+ # @param campaign_id [String] Unique identifier for the campaign. This identifier is a string that always
56
+ # begins with the prefix `dlc_`, for example: `dlc_1234567890`.
55
57
  # @param description [String] Description of the campaign.
56
58
  # @param keywords [Pinnacle::Types::DlcWithExtendedBrandAndStatusKeywords] Keyword response configuration.
57
59
  # @param links [Pinnacle::Types::DlcWithExtendedBrandAndStatusLinks] Legal documentation links.
@@ -59,25 +61,25 @@ module Pinnacle
59
61
  # @param name [String] Display name of the campaign.
60
62
  # @param options [Pinnacle::Types::DlcWithExtendedBrandAndStatusOptions] Campaign configuration options.
61
63
  # @param sample_messages [Array<String>] Example messages for the campaign.
62
- # @param status [Pinnacle::Types::ProfileStatusEnum] Current review status of the campaign.<br>
63
- # `INCOMPLETE`: Not submitted.<br>
64
- # `IN REVIEW`: Being reviewed by carriers.<br>
65
- # `VERIFIED`: Approved and ready to send messages.<br>
66
- # `FAILED`: Issues and errors related to the campaign's details.<br>
64
+ # @param status [Pinnacle::Types::ProfileStatusEnum] Current review status of the campaign. <br>
65
+ # `INCOMPLETE`: Not submitted. <br>
66
+ # `IN REVIEW`: Being reviewed by carriers. <br>
67
+ # `VERIFIED`: Approved and ready to send messages. <br>
68
+ # `FAILED`: Issues and errors related to the campaign's details.
67
69
  # @param use_case [Pinnacle::Types::DlcWithExtendedBrandAndStatusUseCase] Use case for the campaign.
68
70
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
69
71
  # @return [Pinnacle::Types::DlcCampaignWithExtendedBrandAndStatus]
70
- def initialize(auto_renew:, brand:, status:, campaign_id: OMIT, description: OMIT, keywords: OMIT, links: OMIT,
71
- message_flow: OMIT, name: OMIT, options: OMIT, sample_messages: OMIT, use_case: OMIT, additional_properties: nil)
72
+ def initialize(auto_renew:, brand:, keywords:, options:, status:, campaign_id: OMIT, description: OMIT, links: OMIT,
73
+ message_flow: OMIT, name: OMIT, sample_messages: OMIT, use_case: OMIT, additional_properties: nil)
72
74
  @auto_renew = auto_renew
73
75
  @brand = brand
74
76
  @campaign_id = campaign_id if campaign_id != OMIT
75
77
  @description = description if description != OMIT
76
- @keywords = keywords if keywords != OMIT
78
+ @keywords = keywords
77
79
  @links = links if links != OMIT
78
80
  @message_flow = message_flow if message_flow != OMIT
79
81
  @name = name if name != OMIT
80
- @options = options if options != OMIT
82
+ @options = options
81
83
  @sample_messages = sample_messages if sample_messages != OMIT
82
84
  @status = status
83
85
  @use_case = use_case if use_case != OMIT
@@ -178,13 +180,13 @@ module Pinnacle
178
180
  def self.validate_raw(obj:)
179
181
  obj.auto_renew.is_a?(Boolean) != false || raise("Passed value for field obj.auto_renew is not the expected type, validation failed.")
180
182
  Pinnacle::Types::ExtendedBrand.validate_raw(obj: obj.brand)
181
- obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
183
+ obj.campaign_id&.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
182
184
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
183
- obj.keywords.nil? || Pinnacle::Types::DlcWithExtendedBrandAndStatusKeywords.validate_raw(obj: obj.keywords)
185
+ Pinnacle::Types::DlcWithExtendedBrandAndStatusKeywords.validate_raw(obj: obj.keywords)
184
186
  obj.links.nil? || Pinnacle::Types::DlcWithExtendedBrandAndStatusLinks.validate_raw(obj: obj.links)
185
187
  obj.message_flow&.is_a?(String) != false || raise("Passed value for field obj.message_flow is not the expected type, validation failed.")
186
188
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
187
- obj.options.nil? || Pinnacle::Types::DlcWithExtendedBrandAndStatusOptions.validate_raw(obj: obj.options)
189
+ Pinnacle::Types::DlcWithExtendedBrandAndStatusOptions.validate_raw(obj: obj.options)
188
190
  obj.sample_messages&.is_a?(Array) != false || raise("Passed value for field obj.sample_messages is not the expected type, validation failed.")
189
191
  obj.status.is_a?(Pinnacle::Types::ProfileStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
190
192
  obj.use_case.nil? || Pinnacle::Types::DlcWithExtendedBrandAndStatusUseCase.validate_raw(obj: obj.use_case)