rcs 2.0.2 → 2.0.3

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +19 -6
  3. data/lib/rcs/campaigns/dlc/client.rb +12 -12
  4. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_help_keywords.rb → dlc_campaign_help_keywords.rb} +5 -5
  5. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_keywords.rb → dlc_campaign_keywords.rb} +20 -20
  6. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_links.rb → dlc_campaign_links.rb} +5 -5
  7. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_in_keywords.rb → dlc_campaign_opt_in_keywords.rb} +5 -5
  8. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_out_keywords.rb → dlc_campaign_opt_out_keywords.rb} +5 -5
  9. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_options.rb → dlc_campaign_options.rb} +5 -5
  10. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_use_case.rb → dlc_campaign_use_case.rb} +5 -5
  11. data/lib/rcs/campaigns/rcs/client.rb +144 -51
  12. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_agent.rb → rcs_agent.rb} +15 -9
  13. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +122 -43
  14. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_opt_out.rb → rcs_campaign_help_keywords.rb} +20 -19
  15. data/lib/rcs/campaigns/rcs/types/rcs_campaign_keywords.rb +98 -0
  16. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_in_keywords.rb +87 -0
  17. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_out_keywords.rb +83 -0
  18. data/lib/rcs/campaigns/rcs/types/rcs_campaign_traffic.rb +76 -0
  19. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_links.rb → rcs_links.rb} +5 -5
  20. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_use_case.rb → rcs_use_case.rb} +7 -7
  21. data/lib/rcs/campaigns/toll_free/client.rb +53 -10
  22. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +54 -12
  23. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_help_keywords.rb +66 -0
  24. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_keywords.rb +86 -0
  25. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_links.rb +74 -0
  26. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_opt_in.rb → toll_free_campaign_opt_in.rb} +5 -5
  27. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_opt_in_keywords.rb +78 -0
  28. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_options.rb +64 -0
  29. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_use_case.rb → toll_free_campaign_use_case.rb} +5 -5
  30. data/lib/rcs/messages/blast/client.rb +419 -0
  31. data/lib/rcs/messages/blast/types/blast_mms_options.rb +82 -0
  32. data/lib/rcs/messages/blast/types/blast_mms_response.rb +60 -0
  33. data/lib/rcs/messages/blast/types/blast_rcs_options.rb +118 -0
  34. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card.rb +82 -0
  35. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_image_alignment.rb +16 -0
  36. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_orientation.rb +15 -0
  37. data/lib/rcs/messages/blast/types/blast_rcs_response.rb +60 -0
  38. data/lib/rcs/messages/blast/types/blast_sms_options.rb +70 -0
  39. data/lib/rcs/messages/blast/types/blast_sms_response.rb +60 -0
  40. data/lib/rcs/messages/mms/client.rb +6 -6
  41. data/lib/rcs/messages/mms/types/mms_send_response.rb +4 -4
  42. data/lib/rcs/messages/rcs/client.rb +7 -7
  43. data/lib/rcs/messages/rcs/types/{rcs_send_response.rb → send_rich_message_response.rb} +11 -11
  44. data/lib/rcs/messages/schedule/client.rb +103 -0
  45. data/lib/rcs/messages/sms/client.rb +6 -6
  46. data/lib/rcs/messages/sms/types/sms_send_response.rb +4 -4
  47. data/lib/rcs/types/{rcs_base.rb → base_rich_message.rb} +10 -10
  48. data/lib/rcs/types/blast_details.rb +110 -0
  49. data/lib/rcs/types/company_entity_type_enum.rb +14 -0
  50. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +30 -2
  51. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_brand_tier.rb +15 -0
  52. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_tcr_tier.rb +22 -0
  53. data/lib/rcs/types/extended_brand.rb +10 -1
  54. data/lib/rcs/types/extended_brand_with_vetting.rb +10 -1
  55. data/lib/rcs/types/extended_rcs_campaign.rb +122 -51
  56. data/lib/rcs/types/message_schedule.rb +52 -24
  57. data/lib/rcs/types/message_status_enum.rb +1 -0
  58. data/lib/rcs/types/optional_brand_info.rb +10 -1
  59. data/lib/rcs/types/rcs_campaign.rb +122 -43
  60. data/lib/rcs/types/rcs_campaign_schema_extra_keywords.rb +94 -0
  61. data/lib/rcs/types/{rcs_campaign_schema_extra_opt_out.rb → rcs_campaign_schema_extra_keywords_help.rb} +18 -17
  62. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_in.rb +73 -0
  63. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_out.rb +73 -0
  64. data/lib/rcs/types/rcs_campaign_schema_extra_traffic.rb +72 -0
  65. data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +2 -2
  66. data/lib/rcs/types/rcs_campaign_schema_keywords.rb +94 -0
  67. data/lib/rcs/types/{rcs_campaign_schema_opt_out.rb → rcs_campaign_schema_keywords_help.rb} +18 -17
  68. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_in.rb +73 -0
  69. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_out.rb +73 -0
  70. data/lib/rcs/types/rcs_campaign_schema_traffic.rb +72 -0
  71. data/lib/rcs/types/rcs_campaign_schema_use_case.rb +2 -2
  72. data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -2
  73. data/lib/rcs/types/rcs_content.rb +4 -4
  74. data/lib/rcs/types/rcs_messaging_type_enum.rb +17 -0
  75. data/lib/rcs/types/rcs_validate_content.rb +8 -8
  76. data/lib/rcs/types/rcs_validation_result.rb +9 -2
  77. data/lib/rcs/types/{rcs_cards_cards_item.rb → rich_card.rb} +9 -7
  78. data/lib/rcs/types/{rcs_cards.rb → rich_cards.rb} +9 -9
  79. data/lib/rcs/types/rich_cards_message.rb +9 -9
  80. data/lib/rcs/types/rich_media_message.rb +5 -5
  81. data/lib/rcs/types/{send_rcs_card_options_standalone_card.rb → rich_standalone_card_options.rb} +9 -7
  82. data/lib/rcs/types/{rcs_text_content.rb → rich_text.rb} +5 -5
  83. data/lib/rcs/types/rich_text_message.rb +5 -5
  84. data/lib/rcs/types/schedule_cancel_result.rb +58 -0
  85. data/lib/rcs/types/scheduled_blast_details.rb +76 -0
  86. data/lib/rcs/types/scheduled_blast_response_config.rb +89 -0
  87. data/lib/rcs/types/{scheduled_messaage.rb → scheduled_message.rb} +5 -5
  88. data/lib/rcs/types/{send_rcs_card_options.rb → send_rich_cards_options.rb} +18 -14
  89. data/lib/rcs/types/{options.rb → send_rich_message_options.rb} +5 -5
  90. data/lib/rcs/types/{sent_rcs_details.rb → sent_rich_message.rb} +5 -5
  91. data/lib/rcs/types/toll_free_campaign.rb +54 -12
  92. data/lib/rcs/types/toll_free_campaign_schema_keywords.rb +82 -0
  93. data/lib/rcs/types/toll_free_campaign_schema_keywords_help.rb +62 -0
  94. data/lib/rcs/types/toll_free_campaign_schema_keywords_opt_in.rb +74 -0
  95. data/lib/rcs/types/toll_free_campaign_schema_links.rb +70 -0
  96. data/lib/rcs/types/{upsert_toll_free_campaign_opt_in.rb → toll_free_campaign_schema_opt_in.rb} +5 -5
  97. data/lib/rcs/types/toll_free_campaign_schema_options.rb +60 -0
  98. data/lib/rcs/types/{upsert_toll_free_campaign_use_case.rb → toll_free_campaign_schema_use_case.rb} +5 -5
  99. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +54 -12
  100. data/lib/requests.rb +2 -2
  101. data/lib/types_export.rb +66 -32
  102. metadata +70 -34
  103. data/lib/rcs/campaigns/rcs/types/upsert_rcs_opt_in.rb +0 -75
  104. data/lib/rcs/types/rcs_base_options.rb +0 -111
  105. data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +0 -15
  106. data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +0 -71
  107. data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +0 -71
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "blast_rcs_request_options_standalone_card_orientation"
4
+ require_relative "blast_rcs_request_options_standalone_card_image_alignment"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Messages
10
+ module Blast
11
+ module Types
12
+ # Configure standalone card layout options for enhanced visual presentation.
13
+ # > **⚠️ Important Restriction**
14
+ # >
15
+ # > This option is **only valid for single card messages**. Using it with multiple
16
+ # cards will cause the request to fail with a validation error.
17
+ class BlastRcsRequestOptionsStandaloneCard
18
+ # @return [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardOrientation] The orientation of the standalone card.
19
+ attr_reader :orientation
20
+ # @return [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardImageAlignment] The alignment of the image in the standalone card. This field is ignored if
21
+ # orientation is VERTICAL.
22
+ attr_reader :image_alignment
23
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
24
+ attr_reader :additional_properties
25
+ # @return [Object]
26
+ attr_reader :_field_set
27
+ protected :_field_set
28
+
29
+ OMIT = Object.new
30
+
31
+ # @param orientation [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardOrientation] The orientation of the standalone card.
32
+ # @param image_alignment [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardImageAlignment] The alignment of the image in the standalone card. This field is ignored if
33
+ # orientation is VERTICAL.
34
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
35
+ # @return [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCard]
36
+ def initialize(orientation: OMIT, image_alignment: OMIT, additional_properties: nil)
37
+ @orientation = orientation if orientation != OMIT
38
+ @image_alignment = image_alignment if image_alignment != OMIT
39
+ @additional_properties = additional_properties
40
+ @_field_set = { "orientation": orientation, "image_alignment": image_alignment }.reject do |_k, v|
41
+ v == OMIT
42
+ end
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of BlastRcsRequestOptionsStandaloneCard
46
+ #
47
+ # @param json_object [String]
48
+ # @return [Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCard]
49
+ def self.from_json(json_object:)
50
+ struct = JSON.parse(json_object, object_class: OpenStruct)
51
+ parsed_json = JSON.parse(json_object)
52
+ orientation = parsed_json["orientation"]
53
+ image_alignment = parsed_json["image_alignment"]
54
+ new(
55
+ orientation: orientation,
56
+ image_alignment: image_alignment,
57
+ additional_properties: struct
58
+ )
59
+ end
60
+
61
+ # Serialize an instance of BlastRcsRequestOptionsStandaloneCard 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
+ obj.orientation&.is_a?(Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardOrientation) != false || raise("Passed value for field obj.orientation is not the expected type, validation failed.")
76
+ obj.image_alignment&.is_a?(Pinnacle::Messages::Blast::Types::BlastRcsRequestOptionsStandaloneCardImageAlignment) != false || raise("Passed value for field obj.image_alignment is not the expected type, validation failed.")
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Messages
5
+ module Blast
6
+ module Types
7
+ # The alignment of the image in the standalone card. This field is ignored if
8
+ # orientation is VERTICAL.
9
+ class BlastRcsRequestOptionsStandaloneCardImageAlignment
10
+ LEFT = "LEFT"
11
+ RIGHT = "RIGHT"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Messages
5
+ module Blast
6
+ module Types
7
+ # The orientation of the standalone card.
8
+ class BlastRcsRequestOptionsStandaloneCardOrientation
9
+ HORIZONTAL = "HORIZONTAL"
10
+ VERTICAL = "VERTICAL"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "../../../types/blast_details"
5
+ require_relative "../../../types/scheduled_blast_details"
6
+
7
+ module Pinnacle
8
+ module Messages
9
+ module Blast
10
+ module Types
11
+ class BlastRcsResponse
12
+ # Deserialize a JSON object to an instance of BlastRcsResponse
13
+ #
14
+ # @param json_object [String]
15
+ # @return [Pinnacle::Messages::Blast::Types::BlastRcsResponse]
16
+ def self.from_json(json_object:)
17
+ struct = JSON.parse(json_object, object_class: OpenStruct)
18
+ begin
19
+ Pinnacle::Types::BlastDetails.validate_raw(obj: struct)
20
+ return Pinnacle::Types::BlastDetails.from_json(json_object: struct) unless struct.nil?
21
+
22
+ return nil
23
+ rescue StandardError
24
+ # noop
25
+ end
26
+ begin
27
+ Pinnacle::Types::ScheduledBlastDetails.validate_raw(obj: struct)
28
+ return Pinnacle::Types::ScheduledBlastDetails.from_json(json_object: struct) unless struct.nil?
29
+
30
+ return nil
31
+ rescue StandardError
32
+ # noop
33
+ end
34
+ struct
35
+ end
36
+
37
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
38
+ # hash and check each fields type against the current object's property
39
+ # definitions.
40
+ #
41
+ # @param obj [Object]
42
+ # @return [Void]
43
+ def self.validate_raw(obj:)
44
+ begin
45
+ return Pinnacle::Types::BlastDetails.validate_raw(obj: obj)
46
+ rescue StandardError
47
+ # noop
48
+ end
49
+ begin
50
+ return Pinnacle::Types::ScheduledBlastDetails.validate_raw(obj: obj)
51
+ rescue StandardError
52
+ # noop
53
+ end
54
+ raise("Passed value matched no type within the union, validation failed.")
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../types/message_schedule"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Pinnacle
8
+ module Messages
9
+ module Blast
10
+ module Types
11
+ # Additional settings to customize SMS blast delivery.
12
+ class BlastSmsOptions
13
+ # @return [Pinnacle::Types::MessageSchedule]
14
+ attr_reader :schedule
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param schedule [Pinnacle::Types::MessageSchedule]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Pinnacle::Messages::Blast::Types::BlastSmsOptions]
26
+ def initialize(schedule: OMIT, additional_properties: nil)
27
+ @schedule = schedule if schedule != OMIT
28
+ @additional_properties = additional_properties
29
+ @_field_set = { "schedule": schedule }.reject do |_k, v|
30
+ v == OMIT
31
+ end
32
+ end
33
+
34
+ # Deserialize a JSON object to an instance of BlastSmsOptions
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Pinnacle::Messages::Blast::Types::BlastSmsOptions]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ if parsed_json["schedule"].nil?
42
+ schedule = nil
43
+ else
44
+ schedule = parsed_json["schedule"].to_json
45
+ schedule = Pinnacle::Types::MessageSchedule.from_json(json_object: schedule)
46
+ end
47
+ new(schedule: schedule, additional_properties: struct)
48
+ end
49
+
50
+ # Serialize an instance of BlastSmsOptions to a JSON object
51
+ #
52
+ # @return [String]
53
+ def to_json(*_args)
54
+ @_field_set&.to_json
55
+ end
56
+
57
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
58
+ # hash and check each fields type against the current object's property
59
+ # definitions.
60
+ #
61
+ # @param obj [Object]
62
+ # @return [Void]
63
+ def self.validate_raw(obj:)
64
+ obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "../../../types/blast_details"
5
+ require_relative "../../../types/scheduled_blast_details"
6
+
7
+ module Pinnacle
8
+ module Messages
9
+ module Blast
10
+ module Types
11
+ class BlastSmsResponse
12
+ # Deserialize a JSON object to an instance of BlastSmsResponse
13
+ #
14
+ # @param json_object [String]
15
+ # @return [Pinnacle::Messages::Blast::Types::BlastSmsResponse]
16
+ def self.from_json(json_object:)
17
+ struct = JSON.parse(json_object, object_class: OpenStruct)
18
+ begin
19
+ Pinnacle::Types::BlastDetails.validate_raw(obj: struct)
20
+ return Pinnacle::Types::BlastDetails.from_json(json_object: struct) unless struct.nil?
21
+
22
+ return nil
23
+ rescue StandardError
24
+ # noop
25
+ end
26
+ begin
27
+ Pinnacle::Types::ScheduledBlastDetails.validate_raw(obj: struct)
28
+ return Pinnacle::Types::ScheduledBlastDetails.from_json(json_object: struct) unless struct.nil?
29
+
30
+ return nil
31
+ rescue StandardError
32
+ # noop
33
+ end
34
+ struct
35
+ end
36
+
37
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
38
+ # hash and check each fields type against the current object's property
39
+ # definitions.
40
+ #
41
+ # @param obj [Object]
42
+ # @return [Void]
43
+ def self.validate_raw(obj:)
44
+ begin
45
+ return Pinnacle::Types::BlastDetails.validate_raw(obj: obj)
46
+ rescue StandardError
47
+ # noop
48
+ end
49
+ begin
50
+ return Pinnacle::Types::ScheduledBlastDetails.validate_raw(obj: obj)
51
+ rescue StandardError
52
+ # noop
53
+ end
54
+ raise("Passed value matched no type within the union, validation failed.")
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -28,16 +28,16 @@ module Pinnacle
28
28
  # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
29
29
  # * :multiple_messages (Boolean)
30
30
  # * :schedule (Hash)
31
- # * :end_date (String)
32
- # * :recurrence (String)
33
31
  # * :send_at (String)
32
+ # * :recurrence (String)
34
33
  # * :timezone (String)
34
+ # * :end_date (String)
35
35
  # * :tracking (Pinnacle::Types::Tracking)
36
36
  # * :validate (Boolean)
37
37
  # @param text [String] Message text to accompany the media.
38
38
  # @param to [String] Recipient's phone number in E.164 format.
39
39
  # @param request_options [Pinnacle::RequestOptions]
40
- # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessaage]
40
+ # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessage]
41
41
  # @example
42
42
  # api = Pinnacle::Client.new(
43
43
  # base_url: "https://api.example.com",
@@ -128,16 +128,16 @@ module Pinnacle
128
128
  # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
129
129
  # * :multiple_messages (Boolean)
130
130
  # * :schedule (Hash)
131
- # * :end_date (String)
132
- # * :recurrence (String)
133
131
  # * :send_at (String)
132
+ # * :recurrence (String)
134
133
  # * :timezone (String)
134
+ # * :end_date (String)
135
135
  # * :tracking (Pinnacle::Types::Tracking)
136
136
  # * :validate (Boolean)
137
137
  # @param text [String] Message text to accompany the media.
138
138
  # @param to [String] Recipient's phone number in E.164 format.
139
139
  # @param request_options [Pinnacle::RequestOptions]
140
- # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessaage]
140
+ # @return [Pinnacle::Types::SentMmsDetails, Pinnacle::Types::ScheduledMessage]
141
141
  # @example
142
142
  # api = Pinnacle::Client.new(
143
143
  # base_url: "https://api.example.com",
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "json"
4
4
  require_relative "../../../types/sent_mms_details"
5
- require_relative "../../../types/scheduled_messaage"
5
+ require_relative "../../../types/scheduled_message"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
@@ -24,8 +24,8 @@ module Pinnacle
24
24
  # noop
25
25
  end
26
26
  begin
27
- Pinnacle::Types::ScheduledMessaage.validate_raw(obj: struct)
28
- return Pinnacle::Types::ScheduledMessaage.from_json(json_object: struct) unless struct.nil?
27
+ Pinnacle::Types::ScheduledMessage.validate_raw(obj: struct)
28
+ return Pinnacle::Types::ScheduledMessage.from_json(json_object: struct) unless struct.nil?
29
29
 
30
30
  return nil
31
31
  rescue StandardError
@@ -47,7 +47,7 @@ module Pinnacle
47
47
  # noop
48
48
  end
49
49
  begin
50
- return Pinnacle::Types::ScheduledMessaage.validate_raw(obj: obj)
50
+ return Pinnacle::Types::ScheduledMessage.validate_raw(obj: obj)
51
51
  rescue StandardError
52
52
  # noop
53
53
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "../../../requests"
4
4
  require_relative "../../types/rich_message"
5
- require_relative "types/rcs_send_response"
5
+ require_relative "types/send_rich_message_response"
6
6
  require_relative "types/send_typing_indicator_schema_options"
7
7
  require_relative "../../types/send_typing_indicator_response"
8
8
  require_relative "../../types/rcs_validate_content"
@@ -27,7 +27,7 @@ module Pinnacle
27
27
  #
28
28
  # @param request [Pinnacle::Types::RichTextMessage, Pinnacle::Types::RichMediaMessage, Pinnacle::Types::RichCardsMessage]
29
29
  # @param request_options [Pinnacle::RequestOptions]
30
- # @return [Pinnacle::Types::SentRcsDetails, Pinnacle::Types::ScheduledMessaage]
30
+ # @return [Pinnacle::Types::SentRichMessage, Pinnacle::Types::ScheduledMessage]
31
31
  # @example
32
32
  # api = Pinnacle::Client.new(
33
33
  # base_url: "https://api.example.com",
@@ -50,7 +50,7 @@ module Pinnacle
50
50
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
51
51
  req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/rcs"
52
52
  end
53
- Pinnacle::Messages::Rcs::Types::RcsSendResponse.from_json(json_object: response.body)
53
+ Pinnacle::Messages::Rcs::Types::SendRichMessageResponse.from_json(json_object: response.body)
54
54
  end
55
55
 
56
56
  # Send a typing indicator from an RCS agent to a recipient.
@@ -115,7 +115,7 @@ module Pinnacle
115
115
 
116
116
  # Validate RCS message content without sending it.
117
117
  #
118
- # @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
118
+ # @param request [Pinnacle::Types::RichText, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RichCards]
119
119
  # @param request_options [Pinnacle::RequestOptions]
120
120
  # @return [Pinnacle::Types::RcsValidationResult]
121
121
  # @example
@@ -160,7 +160,7 @@ module Pinnacle
160
160
  #
161
161
  # @param request [Pinnacle::Types::RichTextMessage, Pinnacle::Types::RichMediaMessage, Pinnacle::Types::RichCardsMessage]
162
162
  # @param request_options [Pinnacle::RequestOptions]
163
- # @return [Pinnacle::Types::SentRcsDetails, Pinnacle::Types::ScheduledMessaage]
163
+ # @return [Pinnacle::Types::SentRichMessage, Pinnacle::Types::ScheduledMessage]
164
164
  # @example
165
165
  # api = Pinnacle::Client.new(
166
166
  # base_url: "https://api.example.com",
@@ -184,7 +184,7 @@ module Pinnacle
184
184
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
185
185
  req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/rcs"
186
186
  end
187
- Pinnacle::Messages::Rcs::Types::RcsSendResponse.from_json(json_object: response.body)
187
+ Pinnacle::Messages::Rcs::Types::SendRichMessageResponse.from_json(json_object: response.body)
188
188
  end
189
189
  end
190
190
 
@@ -252,7 +252,7 @@ module Pinnacle
252
252
 
253
253
  # Validate RCS message content without sending it.
254
254
  #
255
- # @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
255
+ # @param request [Pinnacle::Types::RichText, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RichCards]
256
256
  # @param request_options [Pinnacle::RequestOptions]
257
257
  # @return [Pinnacle::Types::RcsValidationResult]
258
258
  # @example
@@ -1,31 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
- require_relative "../../../types/sent_rcs_details"
5
- require_relative "../../../types/scheduled_messaage"
4
+ require_relative "../../../types/sent_rich_message"
5
+ require_relative "../../../types/scheduled_message"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
9
9
  module Rcs
10
10
  module Types
11
- class RcsSendResponse
12
- # Deserialize a JSON object to an instance of RcsSendResponse
11
+ class SendRichMessageResponse
12
+ # Deserialize a JSON object to an instance of SendRichMessageResponse
13
13
  #
14
14
  # @param json_object [String]
15
- # @return [Pinnacle::Messages::Rcs::Types::RcsSendResponse]
15
+ # @return [Pinnacle::Messages::Rcs::Types::SendRichMessageResponse]
16
16
  def self.from_json(json_object:)
17
17
  struct = JSON.parse(json_object, object_class: OpenStruct)
18
18
  begin
19
- Pinnacle::Types::SentRcsDetails.validate_raw(obj: struct)
20
- return Pinnacle::Types::SentRcsDetails.from_json(json_object: struct) unless struct.nil?
19
+ Pinnacle::Types::SentRichMessage.validate_raw(obj: struct)
20
+ return Pinnacle::Types::SentRichMessage.from_json(json_object: struct) unless struct.nil?
21
21
 
22
22
  return nil
23
23
  rescue StandardError
24
24
  # noop
25
25
  end
26
26
  begin
27
- Pinnacle::Types::ScheduledMessaage.validate_raw(obj: struct)
28
- return Pinnacle::Types::ScheduledMessaage.from_json(json_object: struct) unless struct.nil?
27
+ Pinnacle::Types::ScheduledMessage.validate_raw(obj: struct)
28
+ return Pinnacle::Types::ScheduledMessage.from_json(json_object: struct) unless struct.nil?
29
29
 
30
30
  return nil
31
31
  rescue StandardError
@@ -42,12 +42,12 @@ module Pinnacle
42
42
  # @return [Void]
43
43
  def self.validate_raw(obj:)
44
44
  begin
45
- return Pinnacle::Types::SentRcsDetails.validate_raw(obj: obj)
45
+ return Pinnacle::Types::SentRichMessage.validate_raw(obj: obj)
46
46
  rescue StandardError
47
47
  # noop
48
48
  end
49
49
  begin
50
- return Pinnacle::Types::ScheduledMessaage.validate_raw(obj: obj)
50
+ return Pinnacle::Types::ScheduledMessage.validate_raw(obj: obj)
51
51
  rescue StandardError
52
52
  # noop
53
53
  end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "../../types/schedule_cancel_result"
5
+ require "async"
6
+
7
+ module Pinnacle
8
+ module Messages
9
+ class ScheduleClient
10
+ # @return [Pinnacle::RequestClient]
11
+ attr_reader :request_client
12
+
13
+ # @param request_client [Pinnacle::RequestClient]
14
+ # @return [Pinnacle::Messages::ScheduleClient]
15
+ def initialize(request_client:)
16
+ @request_client = request_client
17
+ end
18
+
19
+ # Cancel a scheduled message or blast. <br>
20
+ # Works for both individual scheduled messages and scheduled blasts. Use the
21
+ # `scheduleId` returned when the message or blast was scheduled.
22
+ #
23
+ # @param id [String] Unique identifier of the scheduled message. This identifier is a string that
24
+ # always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
25
+ # @param request_options [Pinnacle::RequestOptions]
26
+ # @return [Pinnacle::Types::ScheduleCancelResult]
27
+ # @example
28
+ # api = Pinnacle::Client.new(
29
+ # base_url: "https://api.example.com",
30
+ # environment: Pinnacle::Environment::DEFAULT,
31
+ # api_key: "YOUR_API_KEY"
32
+ # )
33
+ # api.messages.schedule.cancel(id: "id")
34
+ def cancel(id:, request_options: nil)
35
+ response = @request_client.conn.delete do |req|
36
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
37
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
38
+ req.headers = {
39
+ **(req.headers || {}),
40
+ **@request_client.get_headers,
41
+ **(request_options&.additional_headers || {})
42
+ }.compact
43
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
44
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
45
+ end
46
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
47
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
48
+ end
49
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/schedule/#{id}"
50
+ end
51
+ Pinnacle::Types::ScheduleCancelResult.from_json(json_object: response.body)
52
+ end
53
+ end
54
+
55
+ class AsyncScheduleClient
56
+ # @return [Pinnacle::AsyncRequestClient]
57
+ attr_reader :request_client
58
+
59
+ # @param request_client [Pinnacle::AsyncRequestClient]
60
+ # @return [Pinnacle::Messages::AsyncScheduleClient]
61
+ def initialize(request_client:)
62
+ @request_client = request_client
63
+ end
64
+
65
+ # Cancel a scheduled message or blast. <br>
66
+ # Works for both individual scheduled messages and scheduled blasts. Use the
67
+ # `scheduleId` returned when the message or blast was scheduled.
68
+ #
69
+ # @param id [String] Unique identifier of the scheduled message. This identifier is a string that
70
+ # always begins with the prefix `msg_sched_`, for example: `msg_sched_1234567890`.
71
+ # @param request_options [Pinnacle::RequestOptions]
72
+ # @return [Pinnacle::Types::ScheduleCancelResult]
73
+ # @example
74
+ # api = Pinnacle::Client.new(
75
+ # base_url: "https://api.example.com",
76
+ # environment: Pinnacle::Environment::DEFAULT,
77
+ # api_key: "YOUR_API_KEY"
78
+ # )
79
+ # api.messages.schedule.cancel(id: "id")
80
+ def cancel(id:, request_options: nil)
81
+ Async do
82
+ response = @request_client.conn.delete do |req|
83
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
84
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
85
+ req.headers = {
86
+ **(req.headers || {}),
87
+ **@request_client.get_headers,
88
+ **(request_options&.additional_headers || {})
89
+ }.compact
90
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
91
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
92
+ end
93
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
94
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
95
+ end
96
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/schedule/#{id}"
97
+ end
98
+ Pinnacle::Types::ScheduleCancelResult.from_json(json_object: response.body)
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -24,15 +24,15 @@ module Pinnacle
24
24
  # @param from [String] Phone number that sends the message in E.164 format.
25
25
  # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
26
26
  # * :schedule (Hash)
27
- # * :end_date (String)
28
- # * :recurrence (String)
29
27
  # * :send_at (String)
28
+ # * :recurrence (String)
30
29
  # * :timezone (String)
30
+ # * :end_date (String)
31
31
  # * :tracking (Pinnacle::Types::Tracking)
32
32
  # @param text [String] Message content.
33
33
  # @param to [String] Recipient's phone number in E.164 format.
34
34
  # @param request_options [Pinnacle::RequestOptions]
35
- # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessaage]
35
+ # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessage]
36
36
  # @example
37
37
  # api = Pinnacle::Client.new(
38
38
  # base_url: "https://api.example.com",
@@ -115,15 +115,15 @@ module Pinnacle
115
115
  # @param from [String] Phone number that sends the message in E.164 format.
116
116
  # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
117
117
  # * :schedule (Hash)
118
- # * :end_date (String)
119
- # * :recurrence (String)
120
118
  # * :send_at (String)
119
+ # * :recurrence (String)
121
120
  # * :timezone (String)
121
+ # * :end_date (String)
122
122
  # * :tracking (Pinnacle::Types::Tracking)
123
123
  # @param text [String] Message content.
124
124
  # @param to [String] Recipient's phone number in E.164 format.
125
125
  # @param request_options [Pinnacle::RequestOptions]
126
- # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessaage]
126
+ # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessage]
127
127
  # @example
128
128
  # api = Pinnacle::Client.new(
129
129
  # base_url: "https://api.example.com",
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "json"
4
4
  require_relative "../../../types/sent_sms_details"
5
- require_relative "../../../types/scheduled_messaage"
5
+ require_relative "../../../types/scheduled_message"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
@@ -24,8 +24,8 @@ module Pinnacle
24
24
  # noop
25
25
  end
26
26
  begin
27
- Pinnacle::Types::ScheduledMessaage.validate_raw(obj: struct)
28
- return Pinnacle::Types::ScheduledMessaage.from_json(json_object: struct) unless struct.nil?
27
+ Pinnacle::Types::ScheduledMessage.validate_raw(obj: struct)
28
+ return Pinnacle::Types::ScheduledMessage.from_json(json_object: struct) unless struct.nil?
29
29
 
30
30
  return nil
31
31
  rescue StandardError
@@ -47,7 +47,7 @@ module Pinnacle
47
47
  # noop
48
48
  end
49
49
  begin
50
- return Pinnacle::Types::ScheduledMessaage.validate_raw(obj: obj)
50
+ return Pinnacle::Types::ScheduledMessage.validate_raw(obj: obj)
51
51
  rescue StandardError
52
52
  # noop
53
53
  end