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
@@ -0,0 +1,198 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/send_sms_options"
5
+ require_relative "types/sms_send_response"
6
+ require_relative "../../types/sms_content"
7
+ require_relative "../../types/sms_validation_result"
8
+ require "async"
9
+
10
+ module Pinnacle
11
+ module Messages
12
+ class SmsClient
13
+ # @return [Pinnacle::RequestClient]
14
+ attr_reader :request_client
15
+
16
+ # @param request_client [Pinnacle::RequestClient]
17
+ # @return [Pinnacle::Messages::SmsClient]
18
+ def initialize(request_client:)
19
+ @request_client = request_client
20
+ end
21
+
22
+ # Send a SMS message immediately or schedule it for future delivery.
23
+ #
24
+ # @param from [String] Phone number that sends the message in E.164 format.
25
+ # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
26
+ # * :schedule (Hash)
27
+ # * :end_date (DateTime)
28
+ # * :recurrence (String)
29
+ # * :send_at (String)
30
+ # * :timezone (String)
31
+ # * :tracking (Pinnacle::Types::Tracking)
32
+ # @param text [String] Message content.
33
+ # @param to [String] Recipient's phone number in E.164 format.
34
+ # @param request_options [Pinnacle::RequestOptions]
35
+ # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessaage]
36
+ # @example
37
+ # api = Pinnacle::Client.new(
38
+ # base_url: "https://api.example.com",
39
+ # environment: Pinnacle::Environment::DEFAULT,
40
+ # api_key: "YOUR_API_KEY"
41
+ # )
42
+ # api.messages.sms.send_(
43
+ # from: "+14155164736",
44
+ # text: "Hey!",
45
+ # to: "+14154746461"
46
+ # )
47
+ def send_(from:, text:, to:, options: nil, request_options: nil)
48
+ response = @request_client.conn.post do |req|
49
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
50
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
51
+ req.headers = {
52
+ **(req.headers || {}),
53
+ **@request_client.get_headers,
54
+ **(request_options&.additional_headers || {})
55
+ }.compact
56
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
57
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
58
+ end
59
+ req.body = {
60
+ **(request_options&.additional_body_parameters || {}),
61
+ from: from,
62
+ options: options,
63
+ text: text,
64
+ to: to
65
+ }.compact
66
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/sms"
67
+ end
68
+ Pinnacle::Messages::Sms::Types::SmsSendResponse.from_json(json_object: response.body)
69
+ end
70
+
71
+ # Validate SMS message content without sending it.
72
+ #
73
+ # @param request [Hash] Request of type Pinnacle::Types::SmsContent, as a Hash
74
+ # * :text (String)
75
+ # @param request_options [Pinnacle::RequestOptions]
76
+ # @return [Pinnacle::Types::SmsValidationResult]
77
+ # @example
78
+ # api = Pinnacle::Client.new(
79
+ # base_url: "https://api.example.com",
80
+ # environment: Pinnacle::Environment::DEFAULT,
81
+ # api_key: "YOUR_API_KEY"
82
+ # )
83
+ # api.messages.sms.validate(request: { text: "Hello from Pinnacle" })
84
+ def validate(request:, request_options: nil)
85
+ response = @request_client.conn.post do |req|
86
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
87
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
88
+ req.headers = {
89
+ **(req.headers || {}),
90
+ **@request_client.get_headers,
91
+ **(request_options&.additional_headers || {})
92
+ }.compact
93
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
94
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
95
+ end
96
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
97
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/validate/sms"
98
+ end
99
+ Pinnacle::Types::SmsValidationResult.from_json(json_object: response.body)
100
+ end
101
+ end
102
+
103
+ class AsyncSmsClient
104
+ # @return [Pinnacle::AsyncRequestClient]
105
+ attr_reader :request_client
106
+
107
+ # @param request_client [Pinnacle::AsyncRequestClient]
108
+ # @return [Pinnacle::Messages::AsyncSmsClient]
109
+ def initialize(request_client:)
110
+ @request_client = request_client
111
+ end
112
+
113
+ # Send a SMS message immediately or schedule it for future delivery.
114
+ #
115
+ # @param from [String] Phone number that sends the message in E.164 format.
116
+ # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
117
+ # * :schedule (Hash)
118
+ # * :end_date (DateTime)
119
+ # * :recurrence (String)
120
+ # * :send_at (String)
121
+ # * :timezone (String)
122
+ # * :tracking (Pinnacle::Types::Tracking)
123
+ # @param text [String] Message content.
124
+ # @param to [String] Recipient's phone number in E.164 format.
125
+ # @param request_options [Pinnacle::RequestOptions]
126
+ # @return [Pinnacle::Types::SentSmsDetails, Pinnacle::Types::ScheduledMessaage]
127
+ # @example
128
+ # api = Pinnacle::Client.new(
129
+ # base_url: "https://api.example.com",
130
+ # environment: Pinnacle::Environment::DEFAULT,
131
+ # api_key: "YOUR_API_KEY"
132
+ # )
133
+ # api.messages.sms.send_(
134
+ # from: "+14155164736",
135
+ # text: "Hey!",
136
+ # to: "+14154746461"
137
+ # )
138
+ def send_(from:, text:, to:, options: nil, request_options: nil)
139
+ Async do
140
+ response = @request_client.conn.post do |req|
141
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
142
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
143
+ req.headers = {
144
+ **(req.headers || {}),
145
+ **@request_client.get_headers,
146
+ **(request_options&.additional_headers || {})
147
+ }.compact
148
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
149
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
150
+ end
151
+ req.body = {
152
+ **(request_options&.additional_body_parameters || {}),
153
+ from: from,
154
+ options: options,
155
+ text: text,
156
+ to: to
157
+ }.compact
158
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/send/sms"
159
+ end
160
+ Pinnacle::Messages::Sms::Types::SmsSendResponse.from_json(json_object: response.body)
161
+ end
162
+ end
163
+
164
+ # Validate SMS message content without sending it.
165
+ #
166
+ # @param request [Hash] Request of type Pinnacle::Types::SmsContent, as a Hash
167
+ # * :text (String)
168
+ # @param request_options [Pinnacle::RequestOptions]
169
+ # @return [Pinnacle::Types::SmsValidationResult]
170
+ # @example
171
+ # api = Pinnacle::Client.new(
172
+ # base_url: "https://api.example.com",
173
+ # environment: Pinnacle::Environment::DEFAULT,
174
+ # api_key: "YOUR_API_KEY"
175
+ # )
176
+ # api.messages.sms.validate(request: { text: "Hello from Pinnacle" })
177
+ def validate(request:, request_options: nil)
178
+ Async do
179
+ response = @request_client.conn.post do |req|
180
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
181
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
182
+ req.headers = {
183
+ **(req.headers || {}),
184
+ **@request_client.get_headers,
185
+ **(request_options&.additional_headers || {})
186
+ }.compact
187
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
188
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
189
+ end
190
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
191
+ req.url "#{@request_client.get_url(request_options: request_options)}/messages/validate/sms"
192
+ end
193
+ Pinnacle::Types::SmsValidationResult.from_json(json_object: response.body)
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
@@ -7,10 +7,10 @@ require "json"
7
7
 
8
8
  module Pinnacle
9
9
  module Messages
10
- module Send
10
+ module Sms
11
11
  module Types
12
12
  # Additional settings to customize SMS delivery.
13
- class SendSmsSchemaOptions
13
+ class SendSmsOptions
14
14
  # @return [Pinnacle::Types::MessageSchedule]
15
15
  attr_reader :schedule
16
16
  # @return [Pinnacle::Types::Tracking]
@@ -26,7 +26,7 @@ module Pinnacle
26
26
  # @param schedule [Pinnacle::Types::MessageSchedule]
27
27
  # @param tracking [Pinnacle::Types::Tracking]
28
28
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
- # @return [Pinnacle::Messages::Send::Types::SendSmsSchemaOptions]
29
+ # @return [Pinnacle::Messages::Sms::Types::SendSmsOptions]
30
30
  def initialize(schedule: OMIT, tracking: OMIT, additional_properties: nil)
31
31
  @schedule = schedule if schedule != OMIT
32
32
  @tracking = tracking if tracking != OMIT
@@ -36,10 +36,10 @@ module Pinnacle
36
36
  end
37
37
  end
38
38
 
39
- # Deserialize a JSON object to an instance of SendSmsSchemaOptions
39
+ # Deserialize a JSON object to an instance of SendSmsOptions
40
40
  #
41
41
  # @param json_object [String]
42
- # @return [Pinnacle::Messages::Send::Types::SendSmsSchemaOptions]
42
+ # @return [Pinnacle::Messages::Sms::Types::SendSmsOptions]
43
43
  def self.from_json(json_object:)
44
44
  struct = JSON.parse(json_object, object_class: OpenStruct)
45
45
  parsed_json = JSON.parse(json_object)
@@ -57,7 +57,7 @@ module Pinnacle
57
57
  )
58
58
  end
59
59
 
60
- # Serialize an instance of SendSmsSchemaOptions to a JSON object
60
+ # Serialize an instance of SendSmsOptions to a JSON object
61
61
  #
62
62
  # @return [String]
63
63
  def to_json(*_args)
@@ -6,13 +6,13 @@ require_relative "../../../types/scheduled_messaage"
6
6
 
7
7
  module Pinnacle
8
8
  module Messages
9
- module Send
9
+ module Sms
10
10
  module Types
11
- class SendSmsResponse
12
- # Deserialize a JSON object to an instance of SendSmsResponse
11
+ class SmsSendResponse
12
+ # Deserialize a JSON object to an instance of SmsSendResponse
13
13
  #
14
14
  # @param json_object [String]
15
- # @return [Pinnacle::Messages::Send::Types::SendSmsResponse]
15
+ # @return [Pinnacle::Messages::Sms::Types::SmsSendResponse]
16
16
  def self.from_json(json_object:)
17
17
  struct = JSON.parse(json_object, object_class: OpenStruct)
18
18
  begin
@@ -6,7 +6,7 @@ require "json"
6
6
  module Pinnacle
7
7
  module Messages
8
8
  module Types
9
- class MessageReactionSchemaOptions
9
+ class ReactMessageOptions
10
10
  # @return [Boolean] By default, only messages sent with the `options.tracking` field can be
11
11
  # precisely reacted to. <br>
12
12
  # Set `options.force` to true to bypass this restriction (may react to a different
@@ -29,7 +29,7 @@ module Pinnacle
29
29
  # For MMS and RCS, only messages containing text can be tracked. Otherwise,
30
30
  # `options.force` is ignored.
31
31
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
32
- # @return [Pinnacle::Messages::Types::MessageReactionSchemaOptions]
32
+ # @return [Pinnacle::Messages::Types::ReactMessageOptions]
33
33
  def initialize(force: OMIT, additional_properties: nil)
34
34
  @force = force if force != OMIT
35
35
  @additional_properties = additional_properties
@@ -38,10 +38,10 @@ module Pinnacle
38
38
  end
39
39
  end
40
40
 
41
- # Deserialize a JSON object to an instance of MessageReactionSchemaOptions
41
+ # Deserialize a JSON object to an instance of ReactMessageOptions
42
42
  #
43
43
  # @param json_object [String]
44
- # @return [Pinnacle::Messages::Types::MessageReactionSchemaOptions]
44
+ # @return [Pinnacle::Messages::Types::ReactMessageOptions]
45
45
  def self.from_json(json_object:)
46
46
  struct = JSON.parse(json_object, object_class: OpenStruct)
47
47
  parsed_json = JSON.parse(json_object)
@@ -49,7 +49,7 @@ module Pinnacle
49
49
  new(force: force, additional_properties: struct)
50
50
  end
51
51
 
52
- # Serialize an instance of MessageReactionSchemaOptions to a JSON object
52
+ # Serialize an instance of ReactMessageOptions to a JSON object
53
53
  #
54
54
  # @return [String]
55
55
  def to_json(*_args)
@@ -2,15 +2,15 @@
2
2
 
3
3
  require_relative "../../requests"
4
4
  require_relative "../types/phone_feature_enum"
5
- require_relative "types/search_schema_location"
6
- require_relative "types/search_schema_number"
7
- require_relative "types/search_schema_options"
5
+ require_relative "types/search_phone_number_by_location"
6
+ require_relative "types/search_phone_number_by_digits"
7
+ require_relative "types/search_phone_number_options"
8
8
  require_relative "../types/phone_enum"
9
9
  require_relative "../types/phone_number_details"
10
10
  require "json"
11
11
  require_relative "../types/purchased_number"
12
12
  require_relative "types/phone_details_schema_level"
13
- require_relative "types/phone_details_schema_options"
13
+ require_relative "types/retrieve_phone_number_details_options"
14
14
  require_relative "types/phone_numbers_get_response"
15
15
  require_relative "campaign/client"
16
16
  require_relative "webhook/client"
@@ -38,16 +38,16 @@ module Pinnacle
38
38
  # @param features [Array<Pinnacle::Types::PhoneFeatureEnum>]
39
39
  # @param location [Hash] Filter your search by geographic location to find numbers in specific regions.
40
40
  # <br>
41
- # Toll-free numbers ignore city and state filters.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaLocation, as a Hash
41
+ # Toll-free numbers ignore city and state filters.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByLocation, as a Hash
42
42
  # * :city (String)
43
43
  # * :country_code (String)
44
44
  # * :national_destination_code (String)
45
45
  # * :state (String)
46
- # @param phone_number_digit_filters [Hash] Filter your search by digit pattern.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaNumber, as a Hash
46
+ # @param number [Hash] Filter your search by digit pattern.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByDigits, as a Hash
47
47
  # * :contains (String)
48
48
  # * :ends_with (String)
49
49
  # * :starts_with (String)
50
- # @param options [Hash] Extra search settings to control how many results you get.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaOptions, as a Hash
50
+ # @param options [Hash] Extra search settings to control how many results you get.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberOptions, as a Hash
51
51
  # * :limit (Integer)
52
52
  # @param type [Array<Pinnacle::Types::PhoneEnum>] Types of phone numbers to return in your search.
53
53
  # @param request_options [Pinnacle::RequestOptions]
@@ -61,11 +61,11 @@ module Pinnacle
61
61
  # api.phone_numbers.search(
62
62
  # features: [SMS, MMS],
63
63
  # location: { city: "New York", national_destination_code: "212" },
64
- # phone_number_digit_filters: { contains: "514", starts_with: "45" },
64
+ # number: { contains: "514", starts_with: "45" },
65
65
  # options: { limit: 4 },
66
66
  # type: [LOCAL]
67
67
  # )
68
- def search(type:, features: nil, location: nil, phone_number_digit_filters: nil, options: nil, request_options: nil)
68
+ def search(type:, features: nil, location: nil, number: nil, options: nil, request_options: nil)
69
69
  response = @request_client.conn.post do |req|
70
70
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
71
71
  req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -81,7 +81,7 @@ module Pinnacle
81
81
  **(request_options&.additional_body_parameters || {}),
82
82
  features: features,
83
83
  location: location,
84
- number: phone_number_digit_filters,
84
+ number: number,
85
85
  options: options,
86
86
  type: type
87
87
  }.compact
@@ -142,7 +142,7 @@ module Pinnacle
142
142
  # - `basic`: Receive essential info like carrier, location, and format.
143
143
  # - `advanced`: Receive a deeper analysis including fraud risk, detailed location,
144
144
  # and enhanced contact info.
145
- # @param options [Hash] Customize your lookup with additional options.Request of type Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions, as a Hash
145
+ # @param options [Hash] Customize your lookup with additional options.Request of type Pinnacle::PhoneNumbers::Types::RetrievePhoneNumberDetailsOptions, as a Hash
146
146
  # * :force (Boolean)
147
147
  # * :risk (Boolean)
148
148
  # * :enhanced_contact_info (Hash)
@@ -205,16 +205,16 @@ module Pinnacle
205
205
  # @param features [Array<Pinnacle::Types::PhoneFeatureEnum>]
206
206
  # @param location [Hash] Filter your search by geographic location to find numbers in specific regions.
207
207
  # <br>
208
- # Toll-free numbers ignore city and state filters.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaLocation, as a Hash
208
+ # Toll-free numbers ignore city and state filters.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByLocation, as a Hash
209
209
  # * :city (String)
210
210
  # * :country_code (String)
211
211
  # * :national_destination_code (String)
212
212
  # * :state (String)
213
- # @param phone_number_digit_filters [Hash] Filter your search by digit pattern.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaNumber, as a Hash
213
+ # @param number [Hash] Filter your search by digit pattern.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByDigits, as a Hash
214
214
  # * :contains (String)
215
215
  # * :ends_with (String)
216
216
  # * :starts_with (String)
217
- # @param options [Hash] Extra search settings to control how many results you get.Request of type Pinnacle::PhoneNumbers::Types::SearchSchemaOptions, as a Hash
217
+ # @param options [Hash] Extra search settings to control how many results you get.Request of type Pinnacle::PhoneNumbers::Types::SearchPhoneNumberOptions, as a Hash
218
218
  # * :limit (Integer)
219
219
  # @param type [Array<Pinnacle::Types::PhoneEnum>] Types of phone numbers to return in your search.
220
220
  # @param request_options [Pinnacle::RequestOptions]
@@ -228,11 +228,11 @@ module Pinnacle
228
228
  # api.phone_numbers.search(
229
229
  # features: [SMS, MMS],
230
230
  # location: { city: "New York", national_destination_code: "212" },
231
- # phone_number_digit_filters: { contains: "514", starts_with: "45" },
231
+ # number: { contains: "514", starts_with: "45" },
232
232
  # options: { limit: 4 },
233
233
  # type: [LOCAL]
234
234
  # )
235
- def search(type:, features: nil, location: nil, phone_number_digit_filters: nil, options: nil, request_options: nil)
235
+ def search(type:, features: nil, location: nil, number: nil, options: nil, request_options: nil)
236
236
  Async do
237
237
  response = @request_client.conn.post do |req|
238
238
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -249,7 +249,7 @@ module Pinnacle
249
249
  **(request_options&.additional_body_parameters || {}),
250
250
  features: features,
251
251
  location: location,
252
- number: phone_number_digit_filters,
252
+ number: number,
253
253
  options: options,
254
254
  type: type
255
255
  }.compact
@@ -313,7 +313,7 @@ module Pinnacle
313
313
  # - `basic`: Receive essential info like carrier, location, and format.
314
314
  # - `advanced`: Receive a deeper analysis including fraud risk, detailed location,
315
315
  # and enhanced contact info.
316
- # @param options [Hash] Customize your lookup with additional options.Request of type Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions, as a Hash
316
+ # @param options [Hash] Customize your lookup with additional options.Request of type Pinnacle::PhoneNumbers::Types::RetrievePhoneNumberDetailsOptions, as a Hash
317
317
  # * :force (Boolean)
318
318
  # * :risk (Boolean)
319
319
  # * :enhanced_contact_info (Hash)
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  module PhoneNumbers
8
8
  module Types
9
9
  # Additional information to tailor lookup.
10
- class PhoneDetailsSchemaOptionsEnhancedContactInfo
10
+ class EnhancedContactInfo
11
11
  # @return [String] Business context.
12
12
  attr_reader :context
13
13
  # @return [OpenStruct] Additional properties unmapped to the current class definition
@@ -20,7 +20,7 @@ module Pinnacle
20
20
 
21
21
  # @param context [String] Business context.
22
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
- # @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo]
23
+ # @return [Pinnacle::PhoneNumbers::Types::EnhancedContactInfo]
24
24
  def initialize(context: OMIT, additional_properties: nil)
25
25
  @context = context if context != OMIT
26
26
  @additional_properties = additional_properties
@@ -29,11 +29,10 @@ module Pinnacle
29
29
  end
30
30
  end
31
31
 
32
- # Deserialize a JSON object to an instance of
33
- # PhoneDetailsSchemaOptionsEnhancedContactInfo
32
+ # Deserialize a JSON object to an instance of EnhancedContactInfo
34
33
  #
35
34
  # @param json_object [String]
36
- # @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo]
35
+ # @return [Pinnacle::PhoneNumbers::Types::EnhancedContactInfo]
37
36
  def self.from_json(json_object:)
38
37
  struct = JSON.parse(json_object, object_class: OpenStruct)
39
38
  parsed_json = JSON.parse(json_object)
@@ -41,8 +40,7 @@ module Pinnacle
41
40
  new(context: context, additional_properties: struct)
42
41
  end
43
42
 
44
- # Serialize an instance of PhoneDetailsSchemaOptionsEnhancedContactInfo to a JSON
45
- # object
43
+ # Serialize an instance of EnhancedContactInfo to a JSON object
46
44
  #
47
45
  # @return [String]
48
46
  def to_json(*_args)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "phone_details_schema_options_enhanced_contact_info"
3
+ require_relative "enhanced_contact_info"
4
4
  require "ostruct"
5
5
  require "json"
6
6
 
@@ -8,14 +8,14 @@ module Pinnacle
8
8
  module PhoneNumbers
9
9
  module Types
10
10
  # Customize your lookup with additional options.
11
- class PhoneDetailsSchemaOptions
11
+ class RetrievePhoneNumberDetailsOptions
12
12
  # @return [Boolean] Allows you to force a fresh lookup from primary sources instead of cached data.
13
13
  # <br>
14
14
  # Fresh lookups will take longer to complete than cached lookups.
15
15
  attr_reader :force
16
16
  # @return [Boolean] Include a fraud risk and security analysis.
17
17
  attr_reader :risk
18
- # @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo] Additional information to tailor lookup.
18
+ # @return [Pinnacle::PhoneNumbers::Types::EnhancedContactInfo] Additional information to tailor lookup.
19
19
  attr_reader :enhanced_contact_info
20
20
  # @return [OpenStruct] Additional properties unmapped to the current class definition
21
21
  attr_reader :additional_properties
@@ -29,9 +29,9 @@ module Pinnacle
29
29
  # <br>
30
30
  # Fresh lookups will take longer to complete than cached lookups.
31
31
  # @param risk [Boolean] Include a fraud risk and security analysis.
32
- # @param enhanced_contact_info [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo] Additional information to tailor lookup.
32
+ # @param enhanced_contact_info [Pinnacle::PhoneNumbers::Types::EnhancedContactInfo] Additional information to tailor lookup.
33
33
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
34
- # @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions]
34
+ # @return [Pinnacle::PhoneNumbers::Types::RetrievePhoneNumberDetailsOptions]
35
35
  def initialize(force: OMIT, risk: OMIT, enhanced_contact_info: OMIT, additional_properties: nil)
36
36
  @force = force if force != OMIT
37
37
  @risk = risk if risk != OMIT
@@ -46,10 +46,10 @@ module Pinnacle
46
46
  end
47
47
  end
48
48
 
49
- # Deserialize a JSON object to an instance of PhoneDetailsSchemaOptions
49
+ # Deserialize a JSON object to an instance of RetrievePhoneNumberDetailsOptions
50
50
  #
51
51
  # @param json_object [String]
52
- # @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions]
52
+ # @return [Pinnacle::PhoneNumbers::Types::RetrievePhoneNumberDetailsOptions]
53
53
  def self.from_json(json_object:)
54
54
  struct = JSON.parse(json_object, object_class: OpenStruct)
55
55
  parsed_json = JSON.parse(json_object)
@@ -59,7 +59,7 @@ module Pinnacle
59
59
  enhanced_contact_info = nil
60
60
  else
61
61
  enhanced_contact_info = parsed_json["enhanced_contact_info"].to_json
62
- enhanced_contact_info = Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo.from_json(json_object: enhanced_contact_info)
62
+ enhanced_contact_info = Pinnacle::PhoneNumbers::Types::EnhancedContactInfo.from_json(json_object: enhanced_contact_info)
63
63
  end
64
64
  new(
65
65
  force: force,
@@ -69,7 +69,7 @@ module Pinnacle
69
69
  )
70
70
  end
71
71
 
72
- # Serialize an instance of PhoneDetailsSchemaOptions to a JSON object
72
+ # Serialize an instance of RetrievePhoneNumberDetailsOptions to a JSON object
73
73
  #
74
74
  # @return [String]
75
75
  def to_json(*_args)
@@ -85,7 +85,7 @@ module Pinnacle
85
85
  def self.validate_raw(obj:)
86
86
  obj.force&.is_a?(Boolean) != false || raise("Passed value for field obj.force is not the expected type, validation failed.")
87
87
  obj.risk&.is_a?(Boolean) != false || raise("Passed value for field obj.risk is not the expected type, validation failed.")
88
- obj.enhanced_contact_info.nil? || Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo.validate_raw(obj: obj.enhanced_contact_info)
88
+ obj.enhanced_contact_info.nil? || Pinnacle::PhoneNumbers::Types::EnhancedContactInfo.validate_raw(obj: obj.enhanced_contact_info)
89
89
  end
90
90
  end
91
91
  end
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  module PhoneNumbers
8
8
  module Types
9
9
  # Filter your search by digit pattern.
10
- class SearchSchemaNumber
10
+ class SearchPhoneNumberByDigits
11
11
  # @return [String] Your search will return only numbers that contain this digit sequence anywhere
12
12
  # within them.
13
13
  attr_reader :contains
@@ -28,7 +28,7 @@ module Pinnacle
28
28
  # @param ends_with [String] Your search will return only numbers that end with these digits.
29
29
  # @param starts_with [String] Your search will return only numbers that begin with these digits.
30
30
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaNumber]
31
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByDigits]
32
32
  def initialize(contains: OMIT, ends_with: OMIT, starts_with: OMIT, additional_properties: nil)
33
33
  @contains = contains if contains != OMIT
34
34
  @ends_with = ends_with if ends_with != OMIT
@@ -39,10 +39,10 @@ module Pinnacle
39
39
  end
40
40
  end
41
41
 
42
- # Deserialize a JSON object to an instance of SearchSchemaNumber
42
+ # Deserialize a JSON object to an instance of SearchPhoneNumberByDigits
43
43
  #
44
44
  # @param json_object [String]
45
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaNumber]
45
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByDigits]
46
46
  def self.from_json(json_object:)
47
47
  struct = JSON.parse(json_object, object_class: OpenStruct)
48
48
  parsed_json = JSON.parse(json_object)
@@ -57,7 +57,7 @@ module Pinnacle
57
57
  )
58
58
  end
59
59
 
60
- # Serialize an instance of SearchSchemaNumber to a JSON object
60
+ # Serialize an instance of SearchPhoneNumberByDigits to a JSON object
61
61
  #
62
62
  # @return [String]
63
63
  def to_json(*_args)
@@ -9,7 +9,7 @@ module Pinnacle
9
9
  # Filter your search by geographic location to find numbers in specific regions.
10
10
  # <br>
11
11
  # Toll-free numbers ignore city and state filters.
12
- class SearchSchemaLocation
12
+ class SearchPhoneNumberByLocation
13
13
  # @return [String] Search for numbers in your target city.
14
14
  attr_reader :city
15
15
  # @return [String] Currently, only US numbers are supported.
@@ -33,7 +33,7 @@ module Pinnacle
33
33
  # For US numbers, this is usually the 3-digit area code.
34
34
  # @param state [String] Search for numbers in your target state or province using a two-letter code.
35
35
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
36
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaLocation]
36
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByLocation]
37
37
  def initialize(city: OMIT, country_code: OMIT, national_destination_code: OMIT, state: OMIT,
38
38
  additional_properties: nil)
39
39
  @city = city if city != OMIT
@@ -51,10 +51,10 @@ module Pinnacle
51
51
  end
52
52
  end
53
53
 
54
- # Deserialize a JSON object to an instance of SearchSchemaLocation
54
+ # Deserialize a JSON object to an instance of SearchPhoneNumberByLocation
55
55
  #
56
56
  # @param json_object [String]
57
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaLocation]
57
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberByLocation]
58
58
  def self.from_json(json_object:)
59
59
  struct = JSON.parse(json_object, object_class: OpenStruct)
60
60
  parsed_json = JSON.parse(json_object)
@@ -71,7 +71,7 @@ module Pinnacle
71
71
  )
72
72
  end
73
73
 
74
- # Serialize an instance of SearchSchemaLocation to a JSON object
74
+ # Serialize an instance of SearchPhoneNumberByLocation to a JSON object
75
75
  #
76
76
  # @return [String]
77
77
  def to_json(*_args)
@@ -7,7 +7,7 @@ module Pinnacle
7
7
  module PhoneNumbers
8
8
  module Types
9
9
  # Extra search settings to control how many results you get.
10
- class SearchSchemaOptions
10
+ class SearchPhoneNumberOptions
11
11
  # @return [Integer] Set the maximum number of phone numbers to return.
12
12
  attr_reader :limit
13
13
  # @return [OpenStruct] Additional properties unmapped to the current class definition
@@ -20,7 +20,7 @@ module Pinnacle
20
20
 
21
21
  # @param limit [Integer] Set the maximum number of phone numbers to return.
22
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaOptions]
23
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberOptions]
24
24
  def initialize(limit: OMIT, additional_properties: nil)
25
25
  @limit = limit if limit != OMIT
26
26
  @additional_properties = additional_properties
@@ -29,10 +29,10 @@ module Pinnacle
29
29
  end
30
30
  end
31
31
 
32
- # Deserialize a JSON object to an instance of SearchSchemaOptions
32
+ # Deserialize a JSON object to an instance of SearchPhoneNumberOptions
33
33
  #
34
34
  # @param json_object [String]
35
- # @return [Pinnacle::PhoneNumbers::Types::SearchSchemaOptions]
35
+ # @return [Pinnacle::PhoneNumbers::Types::SearchPhoneNumberOptions]
36
36
  def self.from_json(json_object:)
37
37
  struct = JSON.parse(json_object, object_class: OpenStruct)
38
38
  parsed_json = JSON.parse(json_object)
@@ -40,7 +40,7 @@ module Pinnacle
40
40
  new(limit: limit, additional_properties: struct)
41
41
  end
42
42
 
43
- # Serialize an instance of SearchSchemaOptions to a JSON object
43
+ # Serialize an instance of SearchPhoneNumberOptions to a JSON object
44
44
  #
45
45
  # @return [String]
46
46
  def to_json(*_args)