rcs 2.0.0.pre.rc.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +36 -24
  3. data/lib/rcs/campaigns/dlc/client.rb +36 -26
  4. data/lib/rcs/campaigns/rcs/client.rb +26 -22
  5. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +6 -6
  6. data/lib/rcs/campaigns/toll_free/client.rb +32 -26
  7. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +6 -6
  8. data/lib/rcs/contacts/client.rb +10 -8
  9. data/lib/rcs/conversations/client.rb +144 -16
  10. data/lib/rcs/conversations/types/conversations_list_messages_request_direction.rb +12 -0
  11. data/lib/rcs/conversations/types/conversations_list_messages_request_sort_order.rb +12 -0
  12. data/lib/rcs/conversations/types/conversations_list_messages_request_status.rb +17 -0
  13. data/lib/rcs/conversations/types/conversations_list_messages_request_type.rb +13 -0
  14. data/lib/rcs/messages/client.rb +12 -29
  15. data/lib/rcs/messages/rcs/client.rb +125 -1
  16. data/lib/rcs/messages/rcs/types/send_typing_indicator_schema_options.rb +66 -0
  17. data/lib/rcs/phone_numbers/campaign/client.rb +20 -6
  18. data/lib/rcs/phone_numbers/client.rb +0 -14
  19. data/lib/rcs/phone_numbers/webhook/client.rb +12 -10
  20. data/lib/rcs/rcs/client.rb +32 -18
  21. data/lib/rcs/status/get/client.rb +32 -16
  22. data/lib/rcs/tools/contact_card/client.rb +18 -8
  23. data/lib/rcs/tools/file/client.rb +92 -2
  24. data/lib/rcs/tools/file/types/upload_file_options.rb +21 -3
  25. data/lib/rcs/tools/url/client.rb +4 -2
  26. data/lib/rcs/types/attach_webhook_by_id_params.rb +5 -5
  27. data/lib/rcs/types/attach_webhook_response_webhook.rb +5 -3
  28. data/lib/rcs/types/autofill_campaign_params.rb +15 -3
  29. data/lib/rcs/types/autofill_dlc_campaign_response.rb +10 -6
  30. data/lib/rcs/types/autofill_dlc_response_keywords.rb +8 -10
  31. data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +3 -3
  32. data/lib/rcs/types/autofill_dlc_response_keywords_opt_in.rb +6 -4
  33. data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +3 -3
  34. data/lib/rcs/types/autofill_dlc_response_options.rb +12 -12
  35. data/lib/rcs/types/brand_status.rb +5 -3
  36. data/lib/rcs/types/{inbound_button.rb → button_clicked.rb} +7 -7
  37. data/lib/rcs/types/button_clicked_data.rb +80 -0
  38. data/lib/rcs/types/button_clicked_data_button.rb +118 -0
  39. data/lib/rcs/types/{click_action_data.rb → button_clicked_data_button_raw.rb} +10 -8
  40. data/lib/rcs/types/button_clicked_data_button_type.rb +15 -0
  41. data/lib/rcs/types/campaign_query.rb +10 -2
  42. data/lib/rcs/types/contact.rb +5 -3
  43. data/lib/rcs/types/contact_id.rb +5 -3
  44. data/lib/rcs/types/conversation.rb +16 -8
  45. data/lib/rcs/types/conversation_by_id_params.rb +7 -3
  46. data/lib/rcs/types/conversation_contact.rb +5 -3
  47. data/lib/rcs/types/conversation_list.rb +50 -28
  48. data/lib/rcs/types/create_url_options.rb +4 -2
  49. data/lib/rcs/types/detached_webhook_info.rb +5 -3
  50. data/lib/rcs/types/dlc_campaign_status.rb +5 -3
  51. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +21 -19
  52. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +3 -3
  53. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_in.rb +6 -4
  54. data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_opt_out.rb +6 -4
  55. data/lib/rcs/types/extended_brand.rb +25 -13
  56. data/lib/rcs/types/extended_brand_with_vetting.rb +25 -13
  57. data/lib/rcs/types/extended_rcs_campaign.rb +25 -14
  58. data/lib/rcs/types/link_click_event.rb +1 -17
  59. data/lib/rcs/types/message.rb +5 -3
  60. data/lib/rcs/types/message_content.rb +4 -4
  61. data/lib/rcs/types/message_event.rb +143 -0
  62. data/lib/rcs/types/message_event_content.rb +127 -0
  63. data/lib/rcs/types/message_event_conversation.rb +82 -0
  64. data/lib/rcs/types/message_event_direction.rb +11 -0
  65. data/lib/rcs/types/message_event_mms_content.rb +94 -0
  66. data/lib/rcs/types/message_event_rcs_button_data.rb +104 -0
  67. data/lib/rcs/types/message_event_rcs_cards_content.rb +99 -0
  68. data/lib/rcs/types/message_event_rcs_cards_content_cards_item.rb +94 -0
  69. data/lib/rcs/types/message_event_rcs_location_data.rb +91 -0
  70. data/lib/rcs/types/message_event_rcs_media_content.rb +94 -0
  71. data/lib/rcs/types/message_event_rcs_text_content.rb +92 -0
  72. data/lib/rcs/types/message_event_sms_content.rb +81 -0
  73. data/lib/rcs/types/{retrieved_conversations.rb → message_list.rb} +26 -25
  74. data/lib/rcs/types/message_with_reaction.rb +197 -0
  75. data/lib/rcs/types/message_with_reaction_direction.rb +11 -0
  76. data/lib/rcs/types/{error_response.rb → not_found_error_body.rb} +7 -7
  77. data/lib/rcs/types/options.rb +111 -0
  78. data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +7 -3
  79. data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +7 -3
  80. data/lib/rcs/types/pinnacle_file_upload_metadata.rb +18 -2
  81. data/lib/rcs/types/profile_status_enum.rb +4 -4
  82. data/lib/rcs/types/rcs_base_options.rb +12 -1
  83. data/lib/rcs/types/rcs_button_call.rb +11 -2
  84. data/lib/rcs/types/rcs_button_open_url.rb +38 -2
  85. data/lib/rcs/types/rcs_button_open_url_webview_mode.rb +19 -0
  86. data/lib/rcs/types/rcs_button_request_user_location.rb +15 -3
  87. data/lib/rcs/types/rcs_button_schedule_event.rb +9 -1
  88. data/lib/rcs/types/rcs_button_send_location.rb +22 -2
  89. data/lib/rcs/types/rcs_button_trigger.rb +8 -6
  90. data/lib/rcs/types/rcs_campaign.rb +3 -3
  91. data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +8 -8
  92. data/lib/rcs/types/rcs_campaign_status.rb +5 -3
  93. data/lib/rcs/types/reaction_result.rb +10 -6
  94. data/lib/rcs/types/refreshed_file.rb +67 -0
  95. data/lib/rcs/types/rich_cards_message.rb +10 -10
  96. data/lib/rcs/types/{rcs.rb → rich_message.rb} +3 -3
  97. data/lib/rcs/types/scheduled_messaage.rb +5 -3
  98. data/lib/rcs/types/send_rcs_card_options.rb +132 -0
  99. data/lib/rcs/types/send_rcs_card_options_standalone_card.rb +78 -0
  100. data/lib/rcs/types/send_rcs_card_options_standalone_card_image_alignment.rb +12 -0
  101. data/lib/rcs/types/send_rcs_card_options_standalone_card_orientation.rb +11 -0
  102. data/lib/rcs/types/send_typing_indicator_response.rb +100 -0
  103. data/lib/rcs/types/sent_mms_details.rb +4 -2
  104. data/lib/rcs/types/sent_rcs_details.rb +12 -13
  105. data/lib/rcs/types/sent_sms_details.rb +5 -3
  106. data/lib/rcs/types/toll_free_campaign.rb +3 -3
  107. data/lib/rcs/types/toll_free_campaign_status.rb +5 -3
  108. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +3 -5
  109. data/lib/rcs/types/updated_contact_id.rb +5 -3
  110. data/lib/rcs/types/user_event.rb +83 -0
  111. data/lib/rcs/types/user_event_conversation.rb +78 -0
  112. data/lib/rcs/types/v_card_data.rb +5 -3
  113. data/lib/rcs/types/validate_campaign_params.rb +15 -3
  114. data/lib/rcs/types/vcard.rb +5 -3
  115. data/lib/rcs/types/vcard_content.rb +5 -3
  116. data/lib/rcs/types/vcard_resource.rb +5 -3
  117. data/lib/rcs/types/webhook_event_enum.rb +1 -0
  118. data/lib/rcs/types/webhooks.rb +5 -3
  119. data/lib/requests.rb +2 -2
  120. data/lib/types_export.rb +37 -7
  121. metadata +41 -11
  122. data/lib/rcs/types/click_action.rb +0 -73
  123. data/lib/rcs/types/click_action_data_metadata.rb +0 -69
@@ -1,18 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "conversation"
3
+ require_relative "message_with_reaction"
4
4
  require "ostruct"
5
5
  require "json"
6
6
 
7
7
  module Pinnacle
8
8
  module Types
9
- class RetrievedConversations
10
- # @return [Integer] Total number of conversations matching the filter.
11
- attr_reader :count
12
- # @return [Array<Pinnacle::Types::Conversation>]
13
- attr_reader :conversations
14
- # @return [Boolean] Indicates if more conversations are available beyond the current page.
9
+ # Paginated list of messages in a conversation.
10
+ class MessageList
11
+ # @return [Array<Pinnacle::Types::MessageWithReaction>] Array of messages in the conversation.
12
+ attr_reader :messages
13
+ # @return [Boolean] Indicates if more messages are available beyond the current page.
15
14
  attr_reader :has_more
15
+ # @return [Integer] Total number of messages in the conversation.
16
+ attr_reader :count
16
17
  # @return [OpenStruct] Additional properties unmapped to the current class definition
17
18
  attr_reader :additional_properties
18
19
  # @return [Object]
@@ -21,41 +22,41 @@ module Pinnacle
21
22
 
22
23
  OMIT = Object.new
23
24
 
24
- # @param count [Integer] Total number of conversations matching the filter.
25
- # @param conversations [Array<Pinnacle::Types::Conversation>]
26
- # @param has_more [Boolean] Indicates if more conversations are available beyond the current page.
25
+ # @param messages [Array<Pinnacle::Types::MessageWithReaction>] Array of messages in the conversation.
26
+ # @param has_more [Boolean] Indicates if more messages are available beyond the current page.
27
+ # @param count [Integer] Total number of messages in the conversation.
27
28
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
- # @return [Pinnacle::Types::RetrievedConversations]
29
- def initialize(count:, conversations:, has_more:, additional_properties: nil)
30
- @count = count
31
- @conversations = conversations
29
+ # @return [Pinnacle::Types::MessageList]
30
+ def initialize(messages:, has_more:, count:, additional_properties: nil)
31
+ @messages = messages
32
32
  @has_more = has_more
33
+ @count = count
33
34
  @additional_properties = additional_properties
34
- @_field_set = { "count": count, "conversations": conversations, "hasMore": has_more }
35
+ @_field_set = { "messages": messages, "hasMore": has_more, "count": count }
35
36
  end
36
37
 
37
- # Deserialize a JSON object to an instance of RetrievedConversations
38
+ # Deserialize a JSON object to an instance of MessageList
38
39
  #
39
40
  # @param json_object [String]
40
- # @return [Pinnacle::Types::RetrievedConversations]
41
+ # @return [Pinnacle::Types::MessageList]
41
42
  def self.from_json(json_object:)
42
43
  struct = JSON.parse(json_object, object_class: OpenStruct)
43
44
  parsed_json = JSON.parse(json_object)
44
- count = parsed_json["count"]
45
- conversations = parsed_json["conversations"]&.map do |item|
45
+ messages = parsed_json["messages"]&.map do |item|
46
46
  item = item.to_json
47
- Pinnacle::Types::Conversation.from_json(json_object: item)
47
+ Pinnacle::Types::MessageWithReaction.from_json(json_object: item)
48
48
  end
49
49
  has_more = parsed_json["hasMore"]
50
+ count = parsed_json["count"]
50
51
  new(
51
- count: count,
52
- conversations: conversations,
52
+ messages: messages,
53
53
  has_more: has_more,
54
+ count: count,
54
55
  additional_properties: struct
55
56
  )
56
57
  end
57
58
 
58
- # Serialize an instance of RetrievedConversations to a JSON object
59
+ # Serialize an instance of MessageList to a JSON object
59
60
  #
60
61
  # @return [String]
61
62
  def to_json(*_args)
@@ -69,9 +70,9 @@ module Pinnacle
69
70
  # @param obj [Object]
70
71
  # @return [Void]
71
72
  def self.validate_raw(obj:)
72
- obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
73
- obj.conversations.is_a?(Array) != false || raise("Passed value for field obj.conversations is not the expected type, validation failed.")
73
+ obj.messages.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
74
74
  obj.has_more.is_a?(Boolean) != false || raise("Passed value for field obj.has_more is not the expected type, validation failed.")
75
+ obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
75
76
  end
76
77
  end
77
78
  end
@@ -0,0 +1,197 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "message_with_reaction_direction"
4
+ require_relative "message_content"
5
+ require_relative "message_method_enum"
6
+ require_relative "message_status_enum"
7
+ require_relative "message_protocol_enum"
8
+ require "ostruct"
9
+ require "json"
10
+
11
+ module Pinnacle
12
+ module Types
13
+ # Message with additional conversation-specific fields including direction and
14
+ # reaction.
15
+ class MessageWithReaction
16
+ # @return [Pinnacle::Types::MessageWithReactionDirection] Direction of the message flow.
17
+ attr_reader :direction
18
+ # @return [String] Unicode emoji reaction attached to this message. <br>
19
+ # Null indicates no reaction has been added.
20
+ attr_reader :reaction
21
+ # @return [Pinnacle::Types::MessageContent]
22
+ attr_reader :content
23
+ # @return [Float] Total cost charged for sending the message. <br>
24
+ # Null means the message incurred no cost or has not been charged yet.
25
+ attr_reader :cost
26
+ # @return [String] Timestamp indicating when the message was successfully delivered to the
27
+ # recipient. <br>
28
+ # Null indicates the message has not yet been delivered.
29
+ attr_reader :delivered_at
30
+ # @return [String] Detailed explanation of any errors that occurred while delivering the message.
31
+ # <br>
32
+ # Null indicates no errors.
33
+ attr_reader :error
34
+ # @return [String] Unique identifier of the message. This identifier is a string that always begins
35
+ # with the prefix `msg_`, for example: `msg_1234567890`.
36
+ attr_reader :id
37
+ # @return [Pinnacle::Types::MessageMethodEnum]
38
+ attr_reader :method_
39
+ # @return [Integer] Number of segments the message was split into for delivery.
40
+ attr_reader :num_segments
41
+ # @return [String] Phone number that received the message in E.164 format.
42
+ attr_reader :receiver
43
+ # @return [String] Phone number or agent that sent the message.
44
+ attr_reader :sender
45
+ # @return [String] Timestamp indicating when the message was submitted for delivery. <br>
46
+ # Null indicates the message is still in the queue.
47
+ attr_reader :sent_at
48
+ # @return [Pinnacle::Types::MessageStatusEnum]
49
+ attr_reader :status
50
+ # @return [Pinnacle::Types::MessageProtocolEnum]
51
+ attr_reader :type
52
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
53
+ attr_reader :additional_properties
54
+ # @return [Object]
55
+ attr_reader :_field_set
56
+ protected :_field_set
57
+
58
+ OMIT = Object.new
59
+
60
+ # @param direction [Pinnacle::Types::MessageWithReactionDirection] Direction of the message flow.
61
+ # @param reaction [String] Unicode emoji reaction attached to this message. <br>
62
+ # Null indicates no reaction has been added.
63
+ # @param content [Pinnacle::Types::MessageContent]
64
+ # @param cost [Float] Total cost charged for sending the message. <br>
65
+ # Null means the message incurred no cost or has not been charged yet.
66
+ # @param delivered_at [String] Timestamp indicating when the message was successfully delivered to the
67
+ # recipient. <br>
68
+ # Null indicates the message has not yet been delivered.
69
+ # @param error [String] Detailed explanation of any errors that occurred while delivering the message.
70
+ # <br>
71
+ # Null indicates no errors.
72
+ # @param id [String] Unique identifier of the message. This identifier is a string that always begins
73
+ # with the prefix `msg_`, for example: `msg_1234567890`.
74
+ # @param method_ [Pinnacle::Types::MessageMethodEnum]
75
+ # @param num_segments [Integer] Number of segments the message was split into for delivery.
76
+ # @param receiver [String] Phone number that received the message in E.164 format.
77
+ # @param sender [String] Phone number or agent that sent the message.
78
+ # @param sent_at [String] Timestamp indicating when the message was submitted for delivery. <br>
79
+ # Null indicates the message is still in the queue.
80
+ # @param status [Pinnacle::Types::MessageStatusEnum]
81
+ # @param type [Pinnacle::Types::MessageProtocolEnum]
82
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
83
+ # @return [Pinnacle::Types::MessageWithReaction]
84
+ def initialize(direction:, content:, id:, method_:, num_segments:, receiver:, sender:, status:, type:,
85
+ reaction: OMIT, cost: OMIT, delivered_at: OMIT, error: OMIT, sent_at: OMIT, additional_properties: nil)
86
+ @direction = direction
87
+ @reaction = reaction if reaction != OMIT
88
+ @content = content
89
+ @cost = cost if cost != OMIT
90
+ @delivered_at = delivered_at if delivered_at != OMIT
91
+ @error = error if error != OMIT
92
+ @id = id
93
+ @method_ = method_
94
+ @num_segments = num_segments
95
+ @receiver = receiver
96
+ @sender = sender
97
+ @sent_at = sent_at if sent_at != OMIT
98
+ @status = status
99
+ @type = type
100
+ @additional_properties = additional_properties
101
+ @_field_set = {
102
+ "direction": direction,
103
+ "reaction": reaction,
104
+ "content": content,
105
+ "cost": cost,
106
+ "deliveredAt": delivered_at,
107
+ "error": error,
108
+ "id": id,
109
+ "method": method_,
110
+ "numSegments": num_segments,
111
+ "receiver": receiver,
112
+ "sender": sender,
113
+ "sentAt": sent_at,
114
+ "status": status,
115
+ "type": type
116
+ }.reject do |_k, v|
117
+ v == OMIT
118
+ end
119
+ end
120
+
121
+ # Deserialize a JSON object to an instance of MessageWithReaction
122
+ #
123
+ # @param json_object [String]
124
+ # @return [Pinnacle::Types::MessageWithReaction]
125
+ def self.from_json(json_object:)
126
+ struct = JSON.parse(json_object, object_class: OpenStruct)
127
+ parsed_json = JSON.parse(json_object)
128
+ direction = parsed_json["direction"]
129
+ reaction = parsed_json["reaction"]
130
+ if parsed_json["content"].nil?
131
+ content = nil
132
+ else
133
+ content = parsed_json["content"].to_json
134
+ content = Pinnacle::Types::MessageContent.from_json(json_object: content)
135
+ end
136
+ cost = parsed_json["cost"]
137
+ delivered_at = parsed_json["deliveredAt"]
138
+ error = parsed_json["error"]
139
+ id = parsed_json["id"]
140
+ method_ = parsed_json["method"]
141
+ num_segments = parsed_json["numSegments"]
142
+ receiver = parsed_json["receiver"]
143
+ sender = parsed_json["sender"]
144
+ sent_at = parsed_json["sentAt"]
145
+ status = parsed_json["status"]
146
+ type = parsed_json["type"]
147
+ new(
148
+ direction: direction,
149
+ reaction: reaction,
150
+ content: content,
151
+ cost: cost,
152
+ delivered_at: delivered_at,
153
+ error: error,
154
+ id: id,
155
+ method_: method_,
156
+ num_segments: num_segments,
157
+ receiver: receiver,
158
+ sender: sender,
159
+ sent_at: sent_at,
160
+ status: status,
161
+ type: type,
162
+ additional_properties: struct
163
+ )
164
+ end
165
+
166
+ # Serialize an instance of MessageWithReaction to a JSON object
167
+ #
168
+ # @return [String]
169
+ def to_json(*_args)
170
+ @_field_set&.to_json
171
+ end
172
+
173
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
174
+ # hash and check each fields type against the current object's property
175
+ # definitions.
176
+ #
177
+ # @param obj [Object]
178
+ # @return [Void]
179
+ def self.validate_raw(obj:)
180
+ obj.direction.is_a?(Pinnacle::Types::MessageWithReactionDirection) != false || raise("Passed value for field obj.direction is not the expected type, validation failed.")
181
+ obj.reaction&.is_a?(String) != false || raise("Passed value for field obj.reaction is not the expected type, validation failed.")
182
+ Pinnacle::Types::MessageContent.validate_raw(obj: obj.content)
183
+ obj.cost&.is_a?(Float) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.")
184
+ obj.delivered_at&.is_a?(String) != false || raise("Passed value for field obj.delivered_at is not the expected type, validation failed.")
185
+ obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
186
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
187
+ obj.method_.is_a?(Pinnacle::Types::MessageMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
188
+ obj.num_segments.is_a?(Integer) != false || raise("Passed value for field obj.num_segments is not the expected type, validation failed.")
189
+ obj.receiver.is_a?(String) != false || raise("Passed value for field obj.receiver is not the expected type, validation failed.")
190
+ obj.sender.is_a?(String) != false || raise("Passed value for field obj.sender is not the expected type, validation failed.")
191
+ obj.sent_at&.is_a?(String) != false || raise("Passed value for field obj.sent_at is not the expected type, validation failed.")
192
+ obj.status.is_a?(Pinnacle::Types::MessageStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
193
+ obj.type.is_a?(Pinnacle::Types::MessageProtocolEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
194
+ end
195
+ end
196
+ end
197
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ # Direction of the message flow.
6
+ class MessageWithReactionDirection
7
+ INBOUND = "INBOUND"
8
+ OUTBOUND = "OUTBOUND"
9
+ end
10
+ end
11
+ end
@@ -5,8 +5,8 @@ require "json"
5
5
 
6
6
  module Pinnacle
7
7
  module Types
8
- class ErrorResponse
9
- # @return [String] Description of the error that occurred.
8
+ class NotFoundErrorBody
9
+ # @return [String]
10
10
  attr_reader :error
11
11
  # @return [OpenStruct] Additional properties unmapped to the current class definition
12
12
  attr_reader :additional_properties
@@ -16,9 +16,9 @@ module Pinnacle
16
16
 
17
17
  OMIT = Object.new
18
18
 
19
- # @param error [String] Description of the error that occurred.
19
+ # @param error [String]
20
20
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
- # @return [Pinnacle::Types::ErrorResponse]
21
+ # @return [Pinnacle::Types::NotFoundErrorBody]
22
22
  def initialize(error: OMIT, additional_properties: nil)
23
23
  @error = error if error != OMIT
24
24
  @additional_properties = additional_properties
@@ -27,10 +27,10 @@ module Pinnacle
27
27
  end
28
28
  end
29
29
 
30
- # Deserialize a JSON object to an instance of ErrorResponse
30
+ # Deserialize a JSON object to an instance of NotFoundErrorBody
31
31
  #
32
32
  # @param json_object [String]
33
- # @return [Pinnacle::Types::ErrorResponse]
33
+ # @return [Pinnacle::Types::NotFoundErrorBody]
34
34
  def self.from_json(json_object:)
35
35
  struct = JSON.parse(json_object, object_class: OpenStruct)
36
36
  parsed_json = JSON.parse(json_object)
@@ -38,7 +38,7 @@ module Pinnacle
38
38
  new(error: error, additional_properties: struct)
39
39
  end
40
40
 
41
- # Serialize an instance of ErrorResponse to a JSON object
41
+ # Serialize an instance of NotFoundErrorBody to a JSON object
42
42
  #
43
43
  # @return [String]
44
44
  def to_json(*_args)
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "message_schedule"
4
+ require_relative "tracking"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Types
10
+ # Configure how your RCS message is sent and tracked.
11
+ class Options
12
+ # @return [Pinnacle::Types::MessageSchedule]
13
+ attr_reader :schedule
14
+ # @return [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
15
+ # debugging.
16
+ attr_reader :test_mode
17
+ # @return [Pinnacle::Types::Tracking]
18
+ attr_reader :tracking
19
+ # @return [Boolean] Media files and card media will be transcoded to a supported RCS format. This
20
+ # adds a small delay to sending the message. Ignored for rich text messages.
21
+ attr_reader :transcode
22
+ # @return [Boolean] Validate your message for any unsupported files. <br>
23
+ # If failed, errors will be thrown and the message will not send.
24
+ attr_reader :validate
25
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
26
+ attr_reader :additional_properties
27
+ # @return [Object]
28
+ attr_reader :_field_set
29
+ protected :_field_set
30
+
31
+ OMIT = Object.new
32
+
33
+ # @param schedule [Pinnacle::Types::MessageSchedule]
34
+ # @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
35
+ # debugging.
36
+ # @param tracking [Pinnacle::Types::Tracking]
37
+ # @param transcode [Boolean] Media files and card media will be transcoded to a supported RCS format. This
38
+ # adds a small delay to sending the message. Ignored for rich text messages.
39
+ # @param validate [Boolean] Validate your message for any unsupported files. <br>
40
+ # If failed, errors will be thrown and the message will not send.
41
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
+ # @return [Pinnacle::Types::Options]
43
+ def initialize(schedule: OMIT, test_mode: OMIT, tracking: OMIT, transcode: OMIT, validate: OMIT,
44
+ additional_properties: nil)
45
+ @schedule = schedule if schedule != OMIT
46
+ @test_mode = test_mode if test_mode != OMIT
47
+ @tracking = tracking if tracking != OMIT
48
+ @transcode = transcode if transcode != OMIT
49
+ @validate = validate if validate != OMIT
50
+ @additional_properties = additional_properties
51
+ @_field_set = {
52
+ "schedule": schedule,
53
+ "test_mode": test_mode,
54
+ "tracking": tracking,
55
+ "transcode": transcode,
56
+ "validate": validate
57
+ }.reject do |_k, v|
58
+ v == OMIT
59
+ end
60
+ end
61
+
62
+ # Deserialize a JSON object to an instance of Options
63
+ #
64
+ # @param json_object [String]
65
+ # @return [Pinnacle::Types::Options]
66
+ def self.from_json(json_object:)
67
+ struct = JSON.parse(json_object, object_class: OpenStruct)
68
+ parsed_json = JSON.parse(json_object)
69
+ if parsed_json["schedule"].nil?
70
+ schedule = nil
71
+ else
72
+ schedule = parsed_json["schedule"].to_json
73
+ schedule = Pinnacle::Types::MessageSchedule.from_json(json_object: schedule)
74
+ end
75
+ test_mode = parsed_json["test_mode"]
76
+ tracking = parsed_json["tracking"]
77
+ transcode = parsed_json["transcode"]
78
+ validate = parsed_json["validate"]
79
+ new(
80
+ schedule: schedule,
81
+ test_mode: test_mode,
82
+ tracking: tracking,
83
+ transcode: transcode,
84
+ validate: validate,
85
+ additional_properties: struct
86
+ )
87
+ end
88
+
89
+ # Serialize an instance of Options to a JSON object
90
+ #
91
+ # @return [String]
92
+ def to_json(*_args)
93
+ @_field_set&.to_json
94
+ end
95
+
96
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
97
+ # hash and check each fields type against the current object's property
98
+ # definitions.
99
+ #
100
+ # @param obj [Object]
101
+ # @return [Void]
102
+ def self.validate_raw(obj:)
103
+ obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
104
+ obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
105
+ obj.tracking&.is_a?(Pinnacle::Types::Tracking) != false || raise("Passed value for field obj.tracking is not the expected type, validation failed.")
106
+ obj.transcode&.is_a?(Boolean) != false || raise("Passed value for field obj.transcode is not the expected type, validation failed.")
107
+ obj.validate&.is_a?(Boolean) != false || raise("Passed value for field obj.validate is not the expected type, validation failed.")
108
+ end
109
+ end
110
+ end
111
+ end
@@ -8,7 +8,9 @@ module Pinnacle
8
8
  module Types
9
9
  # Campaign that the phone is now attached to.
10
10
  class PhoneNumberCampaignAttachPhoneNumbersItemCampaign
11
- # @return [Integer] Id of the campaign.
11
+ # @return [String] Id of the campaign. For `TOLL_FREE` campaigns, it will begin with the prefix
12
+ # `tf_`, for example: `tf_1234567890`. For `10DLC` campaigns, it will begin with
13
+ # the prefix `dlc_`, for example: `dlc_1234567890`.
12
14
  attr_reader :id
13
15
  # @return [String] Campaign's name.
14
16
  attr_reader :name
@@ -22,7 +24,9 @@ module Pinnacle
22
24
 
23
25
  OMIT = Object.new
24
26
 
25
- # @param id [Integer] Id of the campaign.
27
+ # @param id [String] Id of the campaign. For `TOLL_FREE` campaigns, it will begin with the prefix
28
+ # `tf_`, for example: `tf_1234567890`. For `10DLC` campaigns, it will begin with
29
+ # the prefix `dlc_`, for example: `dlc_1234567890`.
26
30
  # @param name [String] Campaign's name.
27
31
  # @param type [Pinnacle::Types::MessagingProfileEnum]
28
32
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -69,7 +73,7 @@ module Pinnacle
69
73
  # @param obj [Object]
70
74
  # @return [Void]
71
75
  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.")
76
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
73
77
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
78
  obj.type.is_a?(Pinnacle::Types::MessagingProfileEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
75
79
  end
@@ -8,7 +8,9 @@ module Pinnacle
8
8
  module Types
9
9
  # Campaign that the phone is now detached from.
10
10
  class PhoneNumberCampaignDetachPhoneNumbersItemCampaign
11
- # @return [Integer] Id of the campaign.
11
+ # @return [String] Id of the campaign. For `TOLL_FREE` campaigns, it will begin with the prefix
12
+ # `tf_`, for example: `tf_1234567890`. For `10DLC` campaigns, it will begin with
13
+ # the prefix `dlc_`, for example: `dlc_1234567890`.
12
14
  attr_reader :id
13
15
  # @return [String] Campaign's name.
14
16
  attr_reader :name
@@ -22,7 +24,9 @@ module Pinnacle
22
24
 
23
25
  OMIT = Object.new
24
26
 
25
- # @param id [Integer] Id of the campaign.
27
+ # @param id [String] Id of the campaign. For `TOLL_FREE` campaigns, it will begin with the prefix
28
+ # `tf_`, for example: `tf_1234567890`. For `10DLC` campaigns, it will begin with
29
+ # the prefix `dlc_`, for example: `dlc_1234567890`.
26
30
  # @param name [String] Campaign's name.
27
31
  # @param type [Pinnacle::Types::MessagingProfileEnum]
28
32
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -69,7 +73,7 @@ module Pinnacle
69
73
  # @param obj [Object]
70
74
  # @return [Void]
71
75
  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.")
76
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
73
77
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
78
  obj.type.is_a?(Pinnacle::Types::MessagingProfileEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
75
79
  end
@@ -14,6 +14,12 @@ module Pinnacle
14
14
  # Null indicates that `download.expiresAt` was not provided and the expiration
15
15
  # time is defaulted to one hour after uploading.
16
16
  attr_reader :expires_at
17
+ # @return [String] Deletion date for the file in ISO 8601 format. After this date, the file will be
18
+ # automatically deleted from our storage.<br>
19
+ # If this field is not provided, the file will not be deleted. You can still
20
+ # schedule deletion or delete the file manually in the Storage page in the
21
+ # dashboard.
22
+ attr_reader :delete_at
17
23
  # @return [OpenStruct] Additional properties unmapped to the current class definition
18
24
  attr_reader :additional_properties
19
25
  # @return [Object]
@@ -27,17 +33,24 @@ module Pinnacle
27
33
  # @param expires_at [String] Expiration date in ISO 8601 format for file download access.<br>
28
34
  # Null indicates that `download.expiresAt` was not provided and the expiration
29
35
  # time is defaulted to one hour after uploading.
36
+ # @param delete_at [String] Deletion date for the file in ISO 8601 format. After this date, the file will be
37
+ # automatically deleted from our storage.<br>
38
+ # If this field is not provided, the file will not be deleted. You can still
39
+ # schedule deletion or delete the file manually in the Storage page in the
40
+ # dashboard.
30
41
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
42
  # @return [Pinnacle::Types::PinnacleFileUploadMetadata]
32
- def initialize(file_name:, content_type:, expires_at: OMIT, additional_properties: nil)
43
+ def initialize(file_name:, content_type:, expires_at: OMIT, delete_at: OMIT, additional_properties: nil)
33
44
  @file_name = file_name
34
45
  @content_type = content_type
35
46
  @expires_at = expires_at if expires_at != OMIT
47
+ @delete_at = delete_at if delete_at != OMIT
36
48
  @additional_properties = additional_properties
37
49
  @_field_set = {
38
50
  "fileName": file_name,
39
51
  "contentType": content_type,
40
- "expiresAt": expires_at
52
+ "expiresAt": expires_at,
53
+ "deleteAt": delete_at
41
54
  }.reject do |_k, v|
42
55
  v == OMIT
43
56
  end
@@ -53,10 +66,12 @@ module Pinnacle
53
66
  file_name = parsed_json["fileName"]
54
67
  content_type = parsed_json["contentType"]
55
68
  expires_at = parsed_json["expiresAt"]
69
+ delete_at = parsed_json["deleteAt"]
56
70
  new(
57
71
  file_name: file_name,
58
72
  content_type: content_type,
59
73
  expires_at: expires_at,
74
+ delete_at: delete_at,
60
75
  additional_properties: struct
61
76
  )
62
77
  end
@@ -78,6 +93,7 @@ module Pinnacle
78
93
  obj.file_name.is_a?(String) != false || raise("Passed value for field obj.file_name is not the expected type, validation failed.")
79
94
  obj.content_type.is_a?(String) != false || raise("Passed value for field obj.content_type is not the expected type, validation failed.")
80
95
  obj.expires_at&.is_a?(String) != false || raise("Passed value for field obj.expires_at is not the expected type, validation failed.")
96
+ obj.delete_at&.is_a?(String) != false || raise("Passed value for field obj.delete_at is not the expected type, validation failed.")
81
97
  end
82
98
  end
83
99
  end
@@ -2,10 +2,10 @@
2
2
 
3
3
  module Pinnacle
4
4
  module Types
5
- # Current review status of the campaign.
6
- # `INCOMPLETE`: Not submitted.
7
- # `IN REVIEW`: Being reviewed by carriers.
8
- # `VERIFIED`: Approved and ready to send messages.
5
+ # Current review status of the campaign. <br>
6
+ # `INCOMPLETE`: Not submitted. <br>
7
+ # `IN REVIEW`: Being reviewed by carriers. <br>
8
+ # `VERIFIED`: Approved and ready to send messages.<br>
9
9
  # `FAILED`: Issues and errors related to the campaign's details.
10
10
  class ProfileStatusEnum
11
11
  INCOMPLETE = "INCOMPLETE"
@@ -16,6 +16,9 @@ module Pinnacle
16
16
  attr_reader :test_mode
17
17
  # @return [Pinnacle::Types::Tracking]
18
18
  attr_reader :tracking
19
+ # @return [Boolean] Media files and card media will be transcoded to a supported RCS format. This
20
+ # adds a small delay to sending the message. Ignored for rich text messages.
21
+ attr_reader :transcode
19
22
  # @return [Boolean] Validate your message for any unsupported files. <br>
20
23
  # If failed, errors will be thrown and the message will not send.
21
24
  attr_reader :validate
@@ -31,20 +34,25 @@ module Pinnacle
31
34
  # @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
32
35
  # debugging.
33
36
  # @param tracking [Pinnacle::Types::Tracking]
37
+ # @param transcode [Boolean] Media files and card media will be transcoded to a supported RCS format. This
38
+ # adds a small delay to sending the message. Ignored for rich text messages.
34
39
  # @param validate [Boolean] Validate your message for any unsupported files. <br>
35
40
  # If failed, errors will be thrown and the message will not send.
36
41
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
37
42
  # @return [Pinnacle::Types::RcsBaseOptions]
38
- def initialize(schedule: OMIT, test_mode: OMIT, tracking: OMIT, validate: OMIT, additional_properties: nil)
43
+ def initialize(schedule: OMIT, test_mode: OMIT, tracking: OMIT, transcode: OMIT, validate: OMIT,
44
+ additional_properties: nil)
39
45
  @schedule = schedule if schedule != OMIT
40
46
  @test_mode = test_mode if test_mode != OMIT
41
47
  @tracking = tracking if tracking != OMIT
48
+ @transcode = transcode if transcode != OMIT
42
49
  @validate = validate if validate != OMIT
43
50
  @additional_properties = additional_properties
44
51
  @_field_set = {
45
52
  "schedule": schedule,
46
53
  "test_mode": test_mode,
47
54
  "tracking": tracking,
55
+ "transcode": transcode,
48
56
  "validate": validate
49
57
  }.reject do |_k, v|
50
58
  v == OMIT
@@ -66,11 +74,13 @@ module Pinnacle
66
74
  end
67
75
  test_mode = parsed_json["test_mode"]
68
76
  tracking = parsed_json["tracking"]
77
+ transcode = parsed_json["transcode"]
69
78
  validate = parsed_json["validate"]
70
79
  new(
71
80
  schedule: schedule,
72
81
  test_mode: test_mode,
73
82
  tracking: tracking,
83
+ transcode: transcode,
74
84
  validate: validate,
75
85
  additional_properties: struct
76
86
  )
@@ -93,6 +103,7 @@ module Pinnacle
93
103
  obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
94
104
  obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
95
105
  obj.tracking&.is_a?(Pinnacle::Types::Tracking) != false || raise("Passed value for field obj.tracking is not the expected type, validation failed.")
106
+ obj.transcode&.is_a?(Boolean) != false || raise("Passed value for field obj.transcode is not the expected type, validation failed.")
96
107
  obj.validate&.is_a?(Boolean) != false || raise("Passed value for field obj.validate is not the expected type, validation failed.")
97
108
  end
98
109
  end