rcs 2.0.0.pre.rc.2 → 2.0.0.pre.rc.4

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +6 -6
  3. data/lib/rcs/brands/types/{autofill_brand_schema_options.rb → autofill_brand_options.rb} +5 -5
  4. data/lib/rcs/campaigns/dlc/client.rb +12 -12
  5. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_help.rb → upsert_dlc_campaign_help_keywords.rb} +5 -5
  6. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords.rb → upsert_dlc_campaign_keywords.rb} +20 -20
  7. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_links.rb → upsert_dlc_campaign_links.rb} +5 -5
  8. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_in.rb → upsert_dlc_campaign_opt_in_keywords.rb} +5 -5
  9. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_out.rb → upsert_dlc_campaign_opt_out_keywords.rb} +5 -5
  10. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_options.rb → upsert_dlc_campaign_options.rb} +5 -5
  11. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_use_case.rb → upsert_dlc_campaign_use_case.rb} +5 -5
  12. data/lib/rcs/campaigns/rcs/client.rb +39 -29
  13. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_emails_item.rb → rcs_agent_email.rb} +5 -5
  14. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_phones_item.rb → rcs_agent_phone.rb} +5 -5
  15. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_websites_item.rb → rcs_agent_website.rb} +5 -5
  16. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +14 -2
  17. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent.rb → upsert_rcs_agent.rb} +17 -17
  18. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_links.rb → upsert_rcs_links.rb} +5 -5
  19. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_in.rb → upsert_rcs_opt_in.rb} +13 -13
  20. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_out.rb → upsert_rcs_opt_out.rb} +5 -5
  21. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_use_case.rb → upsert_rcs_use_case.rb} +5 -5
  22. data/lib/rcs/campaigns/toll_free/client.rb +4 -4
  23. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +10 -10
  24. data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_opt_in.rb +8 -8
  25. data/lib/rcs/conversations/client.rb +2 -2
  26. data/lib/rcs/messages/client.rb +24 -10
  27. data/lib/rcs/messages/mms/client.rb +118 -0
  28. data/lib/rcs/messages/{send/types/send_mms_response.rb → mms/types/mms_send_response.rb} +4 -4
  29. data/lib/rcs/messages/{send/types/send_mms_schema_options.rb → mms/types/send_mms_options.rb} +6 -6
  30. data/lib/rcs/messages/rcs/client.rb +68 -0
  31. data/lib/rcs/messages/{send/types/send_rcs_response.rb → rcs/types/rcs_send_response.rb} +4 -4
  32. data/lib/rcs/messages/sms/client.rb +198 -0
  33. data/lib/rcs/messages/{send/types/send_sms_schema_options.rb → sms/types/send_sms_options.rb} +6 -6
  34. data/lib/rcs/messages/{send/types/send_sms_response.rb → sms/types/sms_send_response.rb} +4 -4
  35. data/lib/rcs/messages/types/{message_reaction_schema_options.rb → react_message_options.rb} +5 -5
  36. data/lib/rcs/phone_numbers/client.rb +18 -18
  37. data/lib/rcs/phone_numbers/types/{phone_details_schema_options_enhanced_contact_info.rb → enhanced_contact_info.rb} +5 -7
  38. data/lib/rcs/phone_numbers/types/{phone_details_schema_options.rb → retrieve_phone_number_details_options.rb} +10 -10
  39. data/lib/rcs/phone_numbers/types/{search_schema_number.rb → search_phone_number_by_digits.rb} +5 -5
  40. data/lib/rcs/phone_numbers/types/{search_schema_location.rb → search_phone_number_by_location.rb} +5 -5
  41. data/lib/rcs/phone_numbers/types/{search_schema_options.rb → search_phone_number_options.rb} +5 -5
  42. data/lib/rcs/phone_numbers/webhook/client.rb +2 -2
  43. data/lib/rcs/tools/file/client.rb +3 -3
  44. data/lib/rcs/tools/file/types/{file_upload_schema_options_download.rb → download_options.rb} +5 -5
  45. data/lib/rcs/tools/file/types/{file_upload_schema_options.rb → upload_file_options.rb} +10 -10
  46. data/lib/rcs/types/{attach_webhook_schema_webhook_id.rb → attach_webhook_by_id_params.rb} +5 -5
  47. data/lib/rcs/types/attach_webhook_params.rb +8 -8
  48. data/lib/rcs/types/{get_conversation_request_id.rb → conversation_by_id_params.rb} +5 -5
  49. data/lib/rcs/types/{get_conversation_request_recipient.rb → conversation_by_participants_params.rb} +5 -5
  50. data/lib/rcs/types/{attach_webhook_schema_name.rb → create_and_attach_webhook_by_url_params.rb} +5 -5
  51. data/lib/rcs/types/extended_rcs_campaign.rb +13 -1
  52. data/lib/rcs/types/get_conversation_params.rb +8 -8
  53. data/lib/rcs/types/link_click_event.rb +8 -8
  54. data/lib/rcs/types/message.rb +8 -8
  55. data/lib/rcs/types/rcs.rb +12 -12
  56. data/lib/rcs/types/rcs_campaign.rb +14 -2
  57. data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +8 -8
  58. data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +8 -8
  59. data/lib/rcs/types/rcs_cards.rb +4 -4
  60. data/lib/rcs/types/rcs_cards_cards_item.rb +4 -4
  61. data/lib/rcs/types/rcs_cards_content.rb +4 -4
  62. data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -4
  63. data/lib/rcs/types/rcs_media_content.rb +4 -4
  64. data/lib/rcs/types/rcs_text_content.rb +4 -4
  65. data/lib/rcs/types/{rcs_button_content.rb → rich_button.rb} +10 -10
  66. data/lib/rcs/types/{rcs_card.rb → rich_cards_message.rb} +9 -9
  67. data/lib/rcs/types/{rcs_media.rb → rich_media_message.rb} +9 -9
  68. data/lib/rcs/types/{rcs_text.rb → rich_text_message.rb} +9 -9
  69. data/lib/rcs/types/toll_free_campaign.rb +10 -10
  70. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +10 -10
  71. data/lib/rcs/types/{nullable_contact.rb → upsert_contact.rb} +5 -5
  72. data/lib/rcs/types/{toll_free_campaign_schema_opt_in.rb → upsert_toll_free_campaign_opt_in.rb} +13 -13
  73. data/lib/rcs/types/{toll_free_campaign_schema_use_case.rb → upsert_toll_free_campaign_use_case.rb} +5 -5
  74. data/lib/rcs.rb +0 -7
  75. data/lib/requests.rb +2 -2
  76. data/lib/types_export.rb +40 -40
  77. metadata +43 -45
  78. data/lib/rcs/message/client.rb +0 -30
  79. data/lib/rcs/message/sms/client.rb +0 -96
  80. data/lib/rcs/messages/send/client.rb +0 -318
@@ -129,7 +129,7 @@ module Pinnacle
129
129
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
130
130
  # @param name [String] Display name of the campaign.
131
131
  # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaOptIn, as a Hash
132
- # * :method (Pinnacle::Types::OptInMethodEnum)
132
+ # * :method_ (Pinnacle::Types::OptInMethodEnum)
133
133
  # * :url (String)
134
134
  # * :workflow_description (String)
135
135
  # @param production_message_content [String] Explain message that would be sent.
@@ -149,7 +149,7 @@ module Pinnacle
149
149
  # campaign_id: 161,
150
150
  # monthly_volume: ONE_000,
151
151
  # name: "Pinnacle",
152
- # opt_in: { method: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
152
+ # opt_in: { method_: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
153
153
  # production_message_content: "Join Pinnacle's workshop tomorrow and send your first RCS!",
154
154
  # use_case: { summary: "Alerts clients about any Pinnacle hosted workshops.", value: WORKSHOP_ALERTS }
155
155
  # )
@@ -336,7 +336,7 @@ module Pinnacle
336
336
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
337
337
  # @param name [String] Display name of the campaign.
338
338
  # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaOptIn, as a Hash
339
- # * :method (Pinnacle::Types::OptInMethodEnum)
339
+ # * :method_ (Pinnacle::Types::OptInMethodEnum)
340
340
  # * :url (String)
341
341
  # * :workflow_description (String)
342
342
  # @param production_message_content [String] Explain message that would be sent.
@@ -356,7 +356,7 @@ module Pinnacle
356
356
  # campaign_id: 161,
357
357
  # monthly_volume: ONE_000,
358
358
  # name: "Pinnacle",
359
- # opt_in: { method: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
359
+ # opt_in: { method_: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
360
360
  # production_message_content: "Join Pinnacle's workshop tomorrow and send your first RCS!",
361
361
  # use_case: { summary: "Alerts clients about any Pinnacle hosted workshops.", value: WORKSHOP_ALERTS }
362
362
  # )
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../../types/message_volume_enum"
4
- require_relative "../../../types/toll_free_campaign_schema_opt_in"
5
- require_relative "../../../types/toll_free_campaign_schema_use_case"
4
+ require_relative "../../../types/upsert_toll_free_campaign_opt_in"
5
+ require_relative "../../../types/upsert_toll_free_campaign_use_case"
6
6
  require "ostruct"
7
7
  require "json"
8
8
 
@@ -19,11 +19,11 @@ module Pinnacle
19
19
  attr_reader :monthly_volume
20
20
  # @return [String] Display name of the campaign.
21
21
  attr_reader :name
22
- # @return [Pinnacle::Types::TollFreeCampaignSchemaOptIn] Opt-in keyword settings.
22
+ # @return [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
23
23
  attr_reader :opt_in
24
24
  # @return [String] Explain message that would be sent.
25
25
  attr_reader :production_message_content
26
- # @return [Pinnacle::Types::TollFreeCampaignSchemaUseCase] Use case classification for the campaign.
26
+ # @return [Pinnacle::Types::UpsertTollFreeCampaignUseCase] Use case classification for the campaign.
27
27
  attr_reader :use_case
28
28
  # @return [OpenStruct] Additional properties unmapped to the current class definition
29
29
  attr_reader :additional_properties
@@ -37,9 +37,9 @@ module Pinnacle
37
37
  # @param campaign_id [Integer] Unique identifier for the campaign.
38
38
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
39
39
  # @param name [String] Display name of the campaign.
40
- # @param opt_in [Pinnacle::Types::TollFreeCampaignSchemaOptIn] Opt-in keyword settings.
40
+ # @param opt_in [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
41
41
  # @param production_message_content [String] Explain message that would be sent.
42
- # @param use_case [Pinnacle::Types::TollFreeCampaignSchemaUseCase] Use case classification for the campaign.
42
+ # @param use_case [Pinnacle::Types::UpsertTollFreeCampaignUseCase] Use case classification for the campaign.
43
43
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
44
44
  # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeAutofillResponse]
45
45
  def initialize(brand: OMIT, campaign_id: OMIT, monthly_volume: OMIT, name: OMIT, opt_in: OMIT,
@@ -80,14 +80,14 @@ module Pinnacle
80
80
  opt_in = nil
81
81
  else
82
82
  opt_in = parsed_json["optIn"].to_json
83
- opt_in = Pinnacle::Types::TollFreeCampaignSchemaOptIn.from_json(json_object: opt_in)
83
+ opt_in = Pinnacle::Types::UpsertTollFreeCampaignOptIn.from_json(json_object: opt_in)
84
84
  end
85
85
  production_message_content = parsed_json["productionMessageContent"]
86
86
  if parsed_json["useCase"].nil?
87
87
  use_case = nil
88
88
  else
89
89
  use_case = parsed_json["useCase"].to_json
90
- use_case = Pinnacle::Types::TollFreeCampaignSchemaUseCase.from_json(json_object: use_case)
90
+ use_case = Pinnacle::Types::UpsertTollFreeCampaignUseCase.from_json(json_object: use_case)
91
91
  end
92
92
  new(
93
93
  brand: brand,
@@ -119,9 +119,9 @@ module Pinnacle
119
119
  obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
120
120
  obj.monthly_volume&.is_a?(Pinnacle::Types::MessageVolumeEnum) != false || raise("Passed value for field obj.monthly_volume is not the expected type, validation failed.")
121
121
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
122
- obj.opt_in.nil? || Pinnacle::Types::TollFreeCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
122
+ obj.opt_in.nil? || Pinnacle::Types::UpsertTollFreeCampaignOptIn.validate_raw(obj: obj.opt_in)
123
123
  obj.production_message_content&.is_a?(String) != false || raise("Passed value for field obj.production_message_content is not the expected type, validation failed.")
124
- obj.use_case.nil? || Pinnacle::Types::TollFreeCampaignSchemaUseCase.validate_raw(obj: obj.use_case)
124
+ obj.use_case.nil? || Pinnacle::Types::UpsertTollFreeCampaignUseCase.validate_raw(obj: obj.use_case)
125
125
  end
126
126
  end
127
127
  end
@@ -11,7 +11,7 @@ module Pinnacle
11
11
  # Opt-in keyword settings.
12
12
  class UpsertTollFreeSchemaOptIn
13
13
  # @return [Pinnacle::Types::OptInMethodEnum]
14
- attr_reader :method
14
+ attr_reader :method_
15
15
  # @return [String] Url to opt in.
16
16
  attr_reader :url
17
17
  # @return [String] Explain how users find the opt-in.
@@ -24,18 +24,18 @@ module Pinnacle
24
24
 
25
25
  OMIT = Object.new
26
26
 
27
- # @param method [Pinnacle::Types::OptInMethodEnum]
27
+ # @param method_ [Pinnacle::Types::OptInMethodEnum]
28
28
  # @param url [String] Url to opt in.
29
29
  # @param workflow_description [String] Explain how users find the opt-in.
30
30
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
31
  # @return [Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaOptIn]
32
- def initialize(method: OMIT, url: OMIT, workflow_description: OMIT, additional_properties: nil)
33
- @method = method if method != OMIT
32
+ def initialize(method_: OMIT, url: OMIT, workflow_description: OMIT, additional_properties: nil)
33
+ @method_ = method_ if method_ != OMIT
34
34
  @url = url if url != OMIT
35
35
  @workflow_description = workflow_description if workflow_description != OMIT
36
36
  @additional_properties = additional_properties
37
37
  @_field_set = {
38
- "method": method,
38
+ "method": method_,
39
39
  "url": url,
40
40
  "workflowDescription": workflow_description
41
41
  }.reject do |_k, v|
@@ -50,11 +50,11 @@ module Pinnacle
50
50
  def self.from_json(json_object:)
51
51
  struct = JSON.parse(json_object, object_class: OpenStruct)
52
52
  parsed_json = JSON.parse(json_object)
53
- method = parsed_json["method"]
53
+ method_ = parsed_json["method"]
54
54
  url = parsed_json["url"]
55
55
  workflow_description = parsed_json["workflowDescription"]
56
56
  new(
57
- method: method,
57
+ method_: method_,
58
58
  url: url,
59
59
  workflow_description: workflow_description,
60
60
  additional_properties: struct
@@ -75,7 +75,7 @@ module Pinnacle
75
75
  # @param obj [Object]
76
76
  # @return [Void]
77
77
  def self.validate_raw(obj:)
78
- obj.method&.is_a?(Pinnacle::Types::OptInMethodEnum) != false || raise("Passed value for field obj.method is not the expected type, validation failed.")
78
+ obj.method_&.is_a?(Pinnacle::Types::OptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
79
79
  obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
80
80
  obj.workflow_description&.is_a?(String) != false || raise("Passed value for field obj.workflow_description is not the expected type, validation failed.")
81
81
  end
@@ -22,7 +22,7 @@ module Pinnacle
22
22
  # Fetch a specific conversation using either its unique identifier or by matching
23
23
  # sender and recipient details.
24
24
  #
25
- # @param request [Pinnacle::Types::GetConversationRequestId, Pinnacle::Types::GetConversationRequestRecipient]
25
+ # @param request [Pinnacle::Types::ConversationByIdParams, Pinnacle::Types::ConversationByParticipantsParams]
26
26
  # @param request_options [Pinnacle::RequestOptions]
27
27
  # @return [Pinnacle::Types::Conversation]
28
28
  # @example
@@ -150,7 +150,7 @@ module Pinnacle
150
150
  # Fetch a specific conversation using either its unique identifier or by matching
151
151
  # sender and recipient details.
152
152
  #
153
- # @param request [Pinnacle::Types::GetConversationRequestId, Pinnacle::Types::GetConversationRequestRecipient]
153
+ # @param request [Pinnacle::Types::ConversationByIdParams, Pinnacle::Types::ConversationByParticipantsParams]
154
154
  # @param request_options [Pinnacle::RequestOptions]
155
155
  # @return [Pinnacle::Types::Conversation]
156
156
  # @example
@@ -2,23 +2,31 @@
2
2
 
3
3
  require_relative "../../requests"
4
4
  require_relative "../types/message"
5
- require_relative "types/message_reaction_schema_options"
5
+ require_relative "types/react_message_options"
6
6
  require_relative "../types/reaction_result"
7
- require_relative "send/client"
7
+ require_relative "sms/client"
8
+ require_relative "mms/client"
9
+ require_relative "rcs/client"
8
10
  require "async"
9
11
 
10
12
  module Pinnacle
11
13
  class MessagesClient
12
14
  # @return [Pinnacle::RequestClient]
13
15
  attr_reader :request_client
14
- # @return [Pinnacle::Messages::SendClient]
15
- attr_reader :send
16
+ # @return [Pinnacle::Messages::SmsClient]
17
+ attr_reader :sms
18
+ # @return [Pinnacle::Messages::MmsClient]
19
+ attr_reader :mms
20
+ # @return [Pinnacle::Messages::RcsClient]
21
+ attr_reader :rcs
16
22
 
17
23
  # @param request_client [Pinnacle::RequestClient]
18
24
  # @return [Pinnacle::MessagesClient]
19
25
  def initialize(request_client:)
20
26
  @request_client = request_client
21
- @send = Pinnacle::Messages::SendClient.new(request_client: request_client)
27
+ @sms = Pinnacle::Messages::SmsClient.new(request_client: request_client)
28
+ @mms = Pinnacle::Messages::MmsClient.new(request_client: request_client)
29
+ @rcs = Pinnacle::Messages::RcsClient.new(request_client: request_client)
22
30
  end
23
31
 
24
32
  # Retrieve a previously sent message.
@@ -56,7 +64,7 @@ module Pinnacle
56
64
  # Add or remove an emoji reaction to a previously sent message.
57
65
  #
58
66
  # @param message_id [Integer] Unique identifier of the message.
59
- # @param options [Hash] Request of type Pinnacle::Messages::Types::MessageReactionSchemaOptions, as a Hash
67
+ # @param options [Hash] Request of type Pinnacle::Messages::Types::ReactMessageOptions, as a Hash
60
68
  # * :force (Boolean)
61
69
  # @param reaction [String] Unicode emoji to add. <br>
62
70
  # Use `null` to remove existing reaction.
@@ -100,14 +108,20 @@ module Pinnacle
100
108
  class AsyncMessagesClient
101
109
  # @return [Pinnacle::AsyncRequestClient]
102
110
  attr_reader :request_client
103
- # @return [Pinnacle::Messages::AsyncSendClient]
104
- attr_reader :send
111
+ # @return [Pinnacle::Messages::AsyncSmsClient]
112
+ attr_reader :sms
113
+ # @return [Pinnacle::Messages::AsyncMmsClient]
114
+ attr_reader :mms
115
+ # @return [Pinnacle::Messages::AsyncRcsClient]
116
+ attr_reader :rcs
105
117
 
106
118
  # @param request_client [Pinnacle::AsyncRequestClient]
107
119
  # @return [Pinnacle::AsyncMessagesClient]
108
120
  def initialize(request_client:)
109
121
  @request_client = request_client
110
- @send = Pinnacle::Messages::AsyncSendClient.new(request_client: request_client)
122
+ @sms = Pinnacle::Messages::AsyncSmsClient.new(request_client: request_client)
123
+ @mms = Pinnacle::Messages::AsyncMmsClient.new(request_client: request_client)
124
+ @rcs = Pinnacle::Messages::AsyncRcsClient.new(request_client: request_client)
111
125
  end
112
126
 
113
127
  # Retrieve a previously sent message.
@@ -147,7 +161,7 @@ module Pinnacle
147
161
  # Add or remove an emoji reaction to a previously sent message.
148
162
  #
149
163
  # @param message_id [Integer] Unique identifier of the message.
150
- # @param options [Hash] Request of type Pinnacle::Messages::Types::MessageReactionSchemaOptions, as a Hash
164
+ # @param options [Hash] Request of type Pinnacle::Messages::Types::ReactMessageOptions, as a Hash
151
165
  # * :force (Boolean)
152
166
  # @param reaction [String] Unicode emoji to add. <br>
153
167
  # Use `null` to remove existing reaction.
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../../requests"
4
+ require_relative "types/send_mms_options"
5
+ require_relative "types/mms_send_response"
4
6
  require_relative "../../types/mms_content"
5
7
  require_relative "../../types/mms_validation_result"
6
8
  require "async"
@@ -17,6 +19,63 @@ module Pinnacle
17
19
  @request_client = request_client
18
20
  end
19
21
 
22
+ # Send a MMS immediately or schedule it for future delivery.
23
+ #
24
+ # @param from [String] Phone number you want to send the message from in E.164 format.
25
+ # @param media_urls [Array<String>] Media file URLs to send.<br>
26
+ # See [supported media
27
+ # types](https://app.pinnacle.sh/supported-file-types?type=MMS).
28
+ # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
29
+ # * :multiple_messages (Boolean)
30
+ # * :schedule (Hash)
31
+ # * :end_date (DateTime)
32
+ # * :recurrence (String)
33
+ # * :send_at (String)
34
+ # * :timezone (String)
35
+ # * :tracking (Pinnacle::Types::Tracking)
36
+ # * :validate (Boolean)
37
+ # @param text [String] Message text to accompany the media.
38
+ # @param to [String] Recipient's phone number in E.164 format.
39
+ # @param request_options [Pinnacle::RequestOptions]
40
+ # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessaage]
41
+ # @example
42
+ # api = Pinnacle::Client.new(
43
+ # base_url: "https://api.example.com",
44
+ # environment: Pinnacle::Environment::DEFAULT,
45
+ # api_key: "YOUR_API_KEY"
46
+ # )
47
+ # api.messages.mms.send_(
48
+ # from: "+14155164736",
49
+ # media_urls: ["https://fastly.picsum.photos/id/941/300/300.jpg?hmac=mDxM9PWSqRDjecwSCEpzU4bj35gqnG7yA25OL29uNv0"],
50
+ # options: { multiple_messages: true, validate: true },
51
+ # text: "Check out this image!",
52
+ # to: "+14154746461"
53
+ # )
54
+ def send_(from:, media_urls:, text:, to:, options: nil, request_options: nil)
55
+ response = @request_client.conn.post do |req|
56
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
57
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
58
+ req.headers = {
59
+ **(req.headers || {}),
60
+ **@request_client.get_headers,
61
+ **(request_options&.additional_headers || {})
62
+ }.compact
63
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
64
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
65
+ end
66
+ req.body = {
67
+ **(request_options&.additional_body_parameters || {}),
68
+ from: from,
69
+ mediaUrls: media_urls,
70
+ options: options,
71
+ text: text,
72
+ to: to
73
+ }.compact
74
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/mms"
75
+ end
76
+ Pinnacle::Messages::Mms::Types::MmsSendResponse.from_json(json_object: response.body)
77
+ end
78
+
20
79
  # Validate MMS message content without sending it.
21
80
  #
22
81
  # @param request [Hash] Request of type Pinnacle::Types::MmsContent, as a Hash
@@ -60,6 +119,65 @@ module Pinnacle
60
119
  @request_client = request_client
61
120
  end
62
121
 
122
+ # Send a MMS immediately or schedule it for future delivery.
123
+ #
124
+ # @param from [String] Phone number you want to send the message from in E.164 format.
125
+ # @param media_urls [Array<String>] Media file URLs to send.<br>
126
+ # See [supported media
127
+ # types](https://app.pinnacle.sh/supported-file-types?type=MMS).
128
+ # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
129
+ # * :multiple_messages (Boolean)
130
+ # * :schedule (Hash)
131
+ # * :end_date (DateTime)
132
+ # * :recurrence (String)
133
+ # * :send_at (String)
134
+ # * :timezone (String)
135
+ # * :tracking (Pinnacle::Types::Tracking)
136
+ # * :validate (Boolean)
137
+ # @param text [String] Message text to accompany the media.
138
+ # @param to [String] Recipient's phone number in E.164 format.
139
+ # @param request_options [Pinnacle::RequestOptions]
140
+ # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessaage]
141
+ # @example
142
+ # api = Pinnacle::Client.new(
143
+ # base_url: "https://api.example.com",
144
+ # environment: Pinnacle::Environment::DEFAULT,
145
+ # api_key: "YOUR_API_KEY"
146
+ # )
147
+ # api.messages.mms.send_(
148
+ # from: "+14155164736",
149
+ # media_urls: ["https://fastly.picsum.photos/id/941/300/300.jpg?hmac=mDxM9PWSqRDjecwSCEpzU4bj35gqnG7yA25OL29uNv0"],
150
+ # options: { multiple_messages: true, validate: true },
151
+ # text: "Check out this image!",
152
+ # to: "+14154746461"
153
+ # )
154
+ def send_(from:, media_urls:, text:, to:, options: nil, request_options: nil)
155
+ Async do
156
+ response = @request_client.conn.post do |req|
157
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
158
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
159
+ req.headers = {
160
+ **(req.headers || {}),
161
+ **@request_client.get_headers,
162
+ **(request_options&.additional_headers || {})
163
+ }.compact
164
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
165
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
166
+ end
167
+ req.body = {
168
+ **(request_options&.additional_body_parameters || {}),
169
+ from: from,
170
+ mediaUrls: media_urls,
171
+ options: options,
172
+ text: text,
173
+ to: to
174
+ }.compact
175
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/mms"
176
+ end
177
+ Pinnacle::Messages::Mms::Types::MmsSendResponse.from_json(json_object: response.body)
178
+ end
179
+ end
180
+
63
181
  # Validate MMS message content without sending it.
64
182
  #
65
183
  # @param request [Hash] Request of type Pinnacle::Types::MmsContent, as a Hash
@@ -6,13 +6,13 @@ require_relative "../../../types/scheduled_messaage"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
9
- module Send
9
+ module Mms
10
10
  module Types
11
- class SendMmsResponse
12
- # Deserialize a JSON object to an instance of SendMmsResponse
11
+ class MmsSendResponse
12
+ # Deserialize a JSON object to an instance of MmsSendResponse
13
13
  #
14
14
  # @param json_object [String]
15
- # @return [Pinnacle::Messages::Send::Types::SendMmsResponse]
15
+ # @return [Pinnacle::Messages::Mms::Types::MmsSendResponse]
16
16
  def self.from_json(json_object:)
17
17
  struct = JSON.parse(json_object, object_class: OpenStruct)
18
18
  begin
@@ -7,10 +7,10 @@ require "json"
7
7
 
8
8
  module Pinnacle
9
9
  module Messages
10
- module Send
10
+ module Mms
11
11
  module Types
12
12
  # Control how your MMS is processed and delivered.
13
- class SendMmsSchemaOptions
13
+ class SendMmsOptions
14
14
  # @return [Boolean] Allow splitting large content into multiple MMS messages if size limits are
15
15
  # exceeded. <br>
16
16
  # If `false`, MMS over the limit will throw an error and won't be sent.
@@ -40,7 +40,7 @@ module Pinnacle
40
40
  # If errors occur, the message is not sent. Otherwise message is sent after
41
41
  # validation.
42
42
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
43
- # @return [Pinnacle::Messages::Send::Types::SendMmsSchemaOptions]
43
+ # @return [Pinnacle::Messages::Mms::Types::SendMmsOptions]
44
44
  def initialize(multiple_messages:, validate:, schedule: OMIT, tracking: OMIT, additional_properties: nil)
45
45
  @multiple_messages = multiple_messages
46
46
  @schedule = schedule if schedule != OMIT
@@ -57,10 +57,10 @@ module Pinnacle
57
57
  end
58
58
  end
59
59
 
60
- # Deserialize a JSON object to an instance of SendMmsSchemaOptions
60
+ # Deserialize a JSON object to an instance of SendMmsOptions
61
61
  #
62
62
  # @param json_object [String]
63
- # @return [Pinnacle::Messages::Send::Types::SendMmsSchemaOptions]
63
+ # @return [Pinnacle::Messages::Mms::Types::SendMmsOptions]
64
64
  def self.from_json(json_object:)
65
65
  struct = JSON.parse(json_object, object_class: OpenStruct)
66
66
  parsed_json = JSON.parse(json_object)
@@ -82,7 +82,7 @@ module Pinnacle
82
82
  )
83
83
  end
84
84
 
85
- # Serialize an instance of SendMmsSchemaOptions to a JSON object
85
+ # Serialize an instance of SendMmsOptions to a JSON object
86
86
  #
87
87
  # @return [String]
88
88
  def to_json(*_args)
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../../requests"
4
+ require_relative "../../types/rcs"
5
+ require_relative "types/rcs_send_response"
4
6
  require_relative "../../types/rcs_validate_content"
5
7
  require_relative "../../types/rcs_validation_result"
6
8
  require "async"
@@ -17,6 +19,38 @@ module Pinnacle
17
19
  @request_client = request_client
18
20
  end
19
21
 
22
+ # Send a RCS message immediately or schedule it for future delivery. <br>
23
+ # Requires an active RCS agent and recipient devices that support RCS Business
24
+ # Messaging.
25
+ #
26
+ # @param request [Pinnacle::Types::RichTextMessage, Pinnacle::Types::RichMediaMessage, Pinnacle::Types::RichCardsMessage]
27
+ # @param request_options [Pinnacle::RequestOptions]
28
+ # @return [Pinnacle::Types::SentRcsDetails, Pinnacle::Types::ScheduledMessaage]
29
+ # @example
30
+ # api = Pinnacle::Client.new(
31
+ # base_url: "https://api.example.com",
32
+ # environment: Pinnacle::Environment::DEFAULT,
33
+ # api_key: "YOUR_API_KEY"
34
+ # )
35
+ # api.messages.rcs.send_(request: { quick_replies: , text: "text", from: "from", to: "to" })
36
+ def send_(request:, request_options: nil)
37
+ response = @request_client.conn.post do |req|
38
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
39
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
40
+ req.headers = {
41
+ **(req.headers || {}),
42
+ **@request_client.get_headers,
43
+ **(request_options&.additional_headers || {})
44
+ }.compact
45
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
46
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
47
+ end
48
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
49
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/rcs"
50
+ end
51
+ Pinnacle::Messages::Rcs::Types::RcsSendResponse.from_json(json_object: response.body)
52
+ end
53
+
20
54
  # Validate RCS message content without sending it.
21
55
  #
22
56
  # @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
@@ -58,6 +92,40 @@ module Pinnacle
58
92
  @request_client = request_client
59
93
  end
60
94
 
95
+ # Send a RCS message immediately or schedule it for future delivery. <br>
96
+ # Requires an active RCS agent and recipient devices that support RCS Business
97
+ # Messaging.
98
+ #
99
+ # @param request [Pinnacle::Types::RichTextMessage, Pinnacle::Types::RichMediaMessage, Pinnacle::Types::RichCardsMessage]
100
+ # @param request_options [Pinnacle::RequestOptions]
101
+ # @return [Pinnacle::Types::SentRcsDetails, Pinnacle::Types::ScheduledMessaage]
102
+ # @example
103
+ # api = Pinnacle::Client.new(
104
+ # base_url: "https://api.example.com",
105
+ # environment: Pinnacle::Environment::DEFAULT,
106
+ # api_key: "YOUR_API_KEY"
107
+ # )
108
+ # api.messages.rcs.send_(request: { quick_replies: , text: "text", from: "from", to: "to" })
109
+ def send_(request:, request_options: nil)
110
+ Async do
111
+ response = @request_client.conn.post do |req|
112
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
113
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
114
+ req.headers = {
115
+ **(req.headers || {}),
116
+ **@request_client.get_headers,
117
+ **(request_options&.additional_headers || {})
118
+ }.compact
119
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
120
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
121
+ end
122
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
123
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/rcs"
124
+ end
125
+ Pinnacle::Messages::Rcs::Types::RcsSendResponse.from_json(json_object: response.body)
126
+ end
127
+ end
128
+
61
129
  # Validate RCS message content without sending it.
62
130
  #
63
131
  # @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
@@ -6,13 +6,13 @@ require_relative "../../../types/scheduled_messaage"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
9
- module Send
9
+ module Rcs
10
10
  module Types
11
- class SendRcsResponse
12
- # Deserialize a JSON object to an instance of SendRcsResponse
11
+ class RcsSendResponse
12
+ # Deserialize a JSON object to an instance of RcsSendResponse
13
13
  #
14
14
  # @param json_object [String]
15
- # @return [Pinnacle::Messages::Send::Types::SendRcsResponse]
15
+ # @return [Pinnacle::Messages::Rcs::Types::RcsSendResponse]
16
16
  def self.from_json(json_object:)
17
17
  struct = JSON.parse(json_object, object_class: OpenStruct)
18
18
  begin