rcs 2.0.19 → 2.0.20.pre.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.fern/metadata.json +5 -6
- data/lib/pinnacle/calls/client.rb +359 -0
- data/lib/pinnacle/calls/types/calls_download_recording_request.rb +13 -0
- data/lib/pinnacle/calls/types/calls_list_events_request.rb +15 -0
- data/lib/pinnacle/calls/types/calls_list_request.rb +25 -0
- data/lib/pinnacle/calls/types/create_call_params.rb +17 -0
- data/lib/pinnacle/calls/types/create_stream_token_params.rb +17 -0
- data/lib/pinnacle/calls/types/update_call_params.rb +13 -0
- data/lib/pinnacle/client.rb +11 -1
- data/lib/pinnacle/forms/client.rb +1 -1
- data/lib/pinnacle/network/client.rb +34 -0
- data/lib/pinnacle/network/requests/client.rb +94 -0
- data/lib/pinnacle/network/requests/types/list_network_requests_params.rb +21 -0
- data/lib/pinnacle/network/silent_auth/client.rb +107 -0
- data/lib/pinnacle/network/silent_auth/types/silent_auth_check_request.rb +15 -0
- data/lib/pinnacle/network/silent_auth/types/silent_auth_request.rb +17 -0
- data/lib/pinnacle/network/sim_swap/client.rb +55 -0
- data/lib/pinnacle/network/sim_swap/types/sim_swap_request.rb +15 -0
- data/lib/pinnacle/network/subscriber_match/client.rb +55 -0
- data/lib/pinnacle/network/subscriber_match/types/subscriber_match_request.rb +15 -0
- data/lib/pinnacle/pinnacle_client.rb +8 -0
- data/lib/pinnacle/types/agent_summary_carrier_launches.rb +1 -1
- data/lib/pinnacle/types/call.rb +31 -0
- data/lib/pinnacle/types/call_direction.rb +12 -0
- data/lib/pinnacle/types/call_event.rb +27 -0
- data/lib/pinnacle/types/call_event_source.rb +14 -0
- data/lib/pinnacle/types/call_metadata.rb +23 -0
- data/lib/pinnacle/types/call_state.rb +19 -0
- data/lib/pinnacle/types/call_status_event.rb +14 -0
- data/lib/pinnacle/types/call_status_event_call.rb +17 -0
- data/lib/pinnacle/types/call_stream_token.rb +13 -0
- data/lib/pinnacle/types/created_call.rb +33 -0
- data/lib/pinnacle/types/e_164_phone_number.rb +23 -0
- data/lib/pinnacle/types/hosted_silent_auth_response.rb +13 -0
- data/lib/pinnacle/types/json_silent_auth_response.rb +13 -0
- data/lib/pinnacle/types/list_call_events_response.rb +11 -0
- data/lib/pinnacle/types/list_calls_response.rb +11 -0
- data/lib/pinnacle/types/list_network_requests_response.rb +13 -0
- data/lib/pinnacle/types/network_insight_status.rb +14 -0
- data/lib/pinnacle/types/network_request_id.rb +23 -0
- data/lib/pinnacle/types/network_request_result.rb +16 -0
- data/lib/pinnacle/types/network_request_status.rb +15 -0
- data/lib/pinnacle/types/network_request_summary.rb +27 -0
- data/lib/pinnacle/types/network_request_type.rb +13 -0
- data/lib/pinnacle/types/recording_download.rb +11 -0
- data/lib/pinnacle/types/recording_state.rb +14 -0
- data/lib/pinnacle/types/silent_auth_check_response.rb +11 -0
- data/lib/pinnacle/types/silent_auth_check_response_status.rb +12 -0
- data/lib/pinnacle/types/silent_auth_response.rb +15 -0
- data/lib/pinnacle/types/sim_swap_response.rb +15 -0
- data/lib/pinnacle/types/subscriber_match_attributes.rb +30 -0
- data/lib/pinnacle/types/subscriber_match_response.rb +13 -0
- data/lib/pinnacle/types/subscriber_match_response_matches.rb +41 -0
- data/lib/pinnacle/types/subscriber_match_result.rb +18 -0
- data/lib/pinnacle/types/webhook_event_enum.rb +1 -0
- data/lib/pinnacle/version.rb +1 -1
- data/lib/pinnacle/wrapper/messages/client.rb +4 -1
- data/lib/pinnacle/wrapper/voice/client.rb +125 -0
- data/lib/pinnacle/wrapper/voice/types.rb +38 -0
- data/lib/pinnacle/wrapper/voice/voice_socket.rb +354 -0
- data/lib/pinnacle.rb +49 -0
- data/reference.md +1903 -696
- metadata +75 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 707234356d07787fe0f7f144369c4992c305f20cf2b441614bacae5be1e359ca
|
|
4
|
+
data.tar.gz: 052f00f33d7b3a9c549450dc1df576187468e93067aae0eaff59f0fff7391085
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4f1d05255213bf07f6a6edff5bf9b023617a3d2d52819a189b065dc63c3573e7a5cc7acc7a74c7e8c456f88a2a7676e4bcc7e4c78f25a797b64aaf74381122d
|
|
7
|
+
data.tar.gz: 2845f1d4104b24c44a7f8d335f3de9821548a8669795ce40c3781875a2e8486e66836b160b24629dadd0e4c75f2ca61cb1d8b3600a0851650bca5c9e05b57658
|
data/.fern/metadata.json
CHANGED
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
"useProvidedDefaults": true,
|
|
9
9
|
"rubocopVariableNumberStyle": "snake_case"
|
|
10
10
|
},
|
|
11
|
-
"originGitCommit": "
|
|
12
|
-
"originGitCommitIsDirty":
|
|
13
|
-
"invokedBy": "
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
}
|
|
11
|
+
"originGitCommit": "4107f10ce57b97cf22a650949d197352235c1567",
|
|
12
|
+
"originGitCommitIsDirty": true,
|
|
13
|
+
"invokedBy": "manual",
|
|
14
|
+
"sdkVersion": "2.0.20.pre.rc.1"
|
|
15
|
+
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
class Client
|
|
6
|
+
# @param client [Pinnacle::Internal::Http::RawClient]
|
|
7
|
+
#
|
|
8
|
+
# @return [void]
|
|
9
|
+
def initialize(client:)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# List voice calls for your team. Results are sorted newest first.
|
|
14
|
+
#
|
|
15
|
+
# @param request_options [Hash]
|
|
16
|
+
# @param params [Hash]
|
|
17
|
+
# @option request_options [String] :base_url
|
|
18
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
19
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
20
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
21
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
22
|
+
# @option params [Integer, nil] :limit
|
|
23
|
+
# @option params [String, nil] :cursor
|
|
24
|
+
# @option params [Pinnacle::Types::CallState, nil] :state
|
|
25
|
+
# @option params [Pinnacle::Types::CallDirection, nil] :direction
|
|
26
|
+
# @option params [String, nil] :from
|
|
27
|
+
# @option params [String, nil] :to
|
|
28
|
+
# @option params [String, nil] :created_after
|
|
29
|
+
# @option params [String, nil] :created_before
|
|
30
|
+
#
|
|
31
|
+
# @return [Pinnacle::Types::ListCallsResponse]
|
|
32
|
+
def list(request_options: {}, **params)
|
|
33
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
34
|
+
query_params = {}
|
|
35
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
36
|
+
query_params["cursor"] = params[:cursor] if params.key?(:cursor)
|
|
37
|
+
query_params["state"] = params[:state] if params.key?(:state)
|
|
38
|
+
query_params["direction"] = params[:direction] if params.key?(:direction)
|
|
39
|
+
query_params["from"] = params[:from] if params.key?(:from)
|
|
40
|
+
query_params["to"] = params[:to] if params.key?(:to)
|
|
41
|
+
query_params["created_after"] = params[:created_after] if params.key?(:created_after)
|
|
42
|
+
query_params["created_before"] = params[:created_before] if params.key?(:created_before)
|
|
43
|
+
|
|
44
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
45
|
+
base_url: request_options[:base_url],
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "calls",
|
|
48
|
+
query: query_params,
|
|
49
|
+
request_options: request_options
|
|
50
|
+
)
|
|
51
|
+
begin
|
|
52
|
+
response = @client.send(request)
|
|
53
|
+
rescue Net::HTTPRequestTimeout
|
|
54
|
+
raise Pinnacle::Errors::TimeoutError
|
|
55
|
+
end
|
|
56
|
+
code = response.code.to_i
|
|
57
|
+
if code.between?(200, 299)
|
|
58
|
+
Pinnacle::Types::ListCallsResponse.load(response.body)
|
|
59
|
+
else
|
|
60
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
61
|
+
raise error_class.new(response.body, code: code)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Start an outbound voice call from a voice-enabled phone number owned by your team.
|
|
66
|
+
#
|
|
67
|
+
# @param request_options [Hash]
|
|
68
|
+
# @param params [Pinnacle::Calls::Types::CreateCallParams]
|
|
69
|
+
# @option request_options [String] :base_url
|
|
70
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
71
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
72
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
73
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
74
|
+
#
|
|
75
|
+
# @return [Pinnacle::Types::CreatedCall]
|
|
76
|
+
def create(request_options: {}, **params)
|
|
77
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
78
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
79
|
+
base_url: request_options[:base_url],
|
|
80
|
+
method: "POST",
|
|
81
|
+
path: "calls",
|
|
82
|
+
body: Pinnacle::Calls::Types::CreateCallParams.new(params).to_h,
|
|
83
|
+
request_options: request_options
|
|
84
|
+
)
|
|
85
|
+
begin
|
|
86
|
+
response = @client.send(request)
|
|
87
|
+
rescue Net::HTTPRequestTimeout
|
|
88
|
+
raise Pinnacle::Errors::TimeoutError
|
|
89
|
+
end
|
|
90
|
+
code = response.code.to_i
|
|
91
|
+
if code.between?(200, 299)
|
|
92
|
+
Pinnacle::Types::CreatedCall.load(response.body)
|
|
93
|
+
else
|
|
94
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
95
|
+
raise error_class.new(response.body, code: code)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Retrieve one voice call by its Pinnacle call ID.
|
|
100
|
+
#
|
|
101
|
+
# @param request_options [Hash]
|
|
102
|
+
# @param params [Hash]
|
|
103
|
+
# @option request_options [String] :base_url
|
|
104
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
105
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
106
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
107
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
108
|
+
# @option params [String] :id
|
|
109
|
+
#
|
|
110
|
+
# @return [Pinnacle::Types::Call]
|
|
111
|
+
def get(request_options: {}, **params)
|
|
112
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
113
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
114
|
+
base_url: request_options[:base_url],
|
|
115
|
+
method: "GET",
|
|
116
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
117
|
+
request_options: request_options
|
|
118
|
+
)
|
|
119
|
+
begin
|
|
120
|
+
response = @client.send(request)
|
|
121
|
+
rescue Net::HTTPRequestTimeout
|
|
122
|
+
raise Pinnacle::Errors::TimeoutError
|
|
123
|
+
end
|
|
124
|
+
code = response.code.to_i
|
|
125
|
+
if code.between?(200, 299)
|
|
126
|
+
Pinnacle::Types::Call.load(response.body)
|
|
127
|
+
else
|
|
128
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
129
|
+
raise error_class.new(response.body, code: code)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# End a live call. Terminal calls are returned unchanged.
|
|
134
|
+
#
|
|
135
|
+
# @param request_options [Hash]
|
|
136
|
+
# @param params [Hash]
|
|
137
|
+
# @option request_options [String] :base_url
|
|
138
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
139
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
140
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
141
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
142
|
+
# @option params [String] :id
|
|
143
|
+
#
|
|
144
|
+
# @return [Pinnacle::Types::Call]
|
|
145
|
+
def cancel(request_options: {}, **params)
|
|
146
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
147
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
148
|
+
base_url: request_options[:base_url],
|
|
149
|
+
method: "DELETE",
|
|
150
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
151
|
+
request_options: request_options
|
|
152
|
+
)
|
|
153
|
+
begin
|
|
154
|
+
response = @client.send(request)
|
|
155
|
+
rescue Net::HTTPRequestTimeout
|
|
156
|
+
raise Pinnacle::Errors::TimeoutError
|
|
157
|
+
end
|
|
158
|
+
code = response.code.to_i
|
|
159
|
+
if code.between?(200, 299)
|
|
160
|
+
Pinnacle::Types::Call.load(response.body)
|
|
161
|
+
else
|
|
162
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
163
|
+
raise error_class.new(response.body, code: code)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Replace a call's metadata. For live calls, future call events carry the updated metadata.
|
|
168
|
+
#
|
|
169
|
+
# @param request_options [Hash]
|
|
170
|
+
# @param params [Pinnacle::Calls::Types::UpdateCallParams]
|
|
171
|
+
# @option request_options [String] :base_url
|
|
172
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
173
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
174
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
175
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
176
|
+
# @option params [String] :id
|
|
177
|
+
#
|
|
178
|
+
# @return [Pinnacle::Types::Call]
|
|
179
|
+
def update(request_options: {}, **params)
|
|
180
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
181
|
+
request_data = Pinnacle::Calls::Types::UpdateCallParams.new(params).to_h
|
|
182
|
+
non_body_param_names = %w[id]
|
|
183
|
+
body = request_data.except(*non_body_param_names)
|
|
184
|
+
|
|
185
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
186
|
+
base_url: request_options[:base_url],
|
|
187
|
+
method: "PATCH",
|
|
188
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
189
|
+
body: body,
|
|
190
|
+
request_options: request_options
|
|
191
|
+
)
|
|
192
|
+
begin
|
|
193
|
+
response = @client.send(request)
|
|
194
|
+
rescue Net::HTTPRequestTimeout
|
|
195
|
+
raise Pinnacle::Errors::TimeoutError
|
|
196
|
+
end
|
|
197
|
+
code = response.code.to_i
|
|
198
|
+
if code.between?(200, 299)
|
|
199
|
+
Pinnacle::Types::Call.load(response.body)
|
|
200
|
+
else
|
|
201
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
202
|
+
raise error_class.new(response.body, code: code)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# List the event timeline for a call.
|
|
207
|
+
#
|
|
208
|
+
# @param request_options [Hash]
|
|
209
|
+
# @param params [Hash]
|
|
210
|
+
# @option request_options [String] :base_url
|
|
211
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
212
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
213
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
214
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
215
|
+
# @option params [String] :id
|
|
216
|
+
# @option params [Integer, nil] :limit
|
|
217
|
+
# @option params [String, nil] :cursor
|
|
218
|
+
#
|
|
219
|
+
# @return [Pinnacle::Types::ListCallEventsResponse]
|
|
220
|
+
def list_events(request_options: {}, **params)
|
|
221
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
222
|
+
query_params = {}
|
|
223
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
224
|
+
query_params["cursor"] = params[:cursor] if params.key?(:cursor)
|
|
225
|
+
|
|
226
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
227
|
+
base_url: request_options[:base_url],
|
|
228
|
+
method: "GET",
|
|
229
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}/events",
|
|
230
|
+
query: query_params,
|
|
231
|
+
request_options: request_options
|
|
232
|
+
)
|
|
233
|
+
begin
|
|
234
|
+
response = @client.send(request)
|
|
235
|
+
rescue Net::HTTPRequestTimeout
|
|
236
|
+
raise Pinnacle::Errors::TimeoutError
|
|
237
|
+
end
|
|
238
|
+
code = response.code.to_i
|
|
239
|
+
if code.between?(200, 299)
|
|
240
|
+
Pinnacle::Types::ListCallEventsResponse.load(response.body)
|
|
241
|
+
else
|
|
242
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
243
|
+
raise error_class.new(response.body, code: code)
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Mint a short-lived WebSocket token for a call. Use the returned `stream_url` to connect to Pinnacle's
|
|
248
|
+
# bidirectional voice stream.
|
|
249
|
+
#
|
|
250
|
+
# @param request_options [Hash]
|
|
251
|
+
# @param params [Pinnacle::Calls::Types::CreateStreamTokenParams]
|
|
252
|
+
# @option request_options [String] :base_url
|
|
253
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
254
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
255
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
256
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
257
|
+
# @option params [String] :id
|
|
258
|
+
#
|
|
259
|
+
# @return [Pinnacle::Types::CallStreamToken]
|
|
260
|
+
def create_stream_token(request_options: {}, **params)
|
|
261
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
262
|
+
request_data = Pinnacle::Calls::Types::CreateStreamTokenParams.new(params).to_h
|
|
263
|
+
non_body_param_names = %w[id]
|
|
264
|
+
body = request_data.except(*non_body_param_names)
|
|
265
|
+
|
|
266
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
267
|
+
base_url: request_options[:base_url],
|
|
268
|
+
method: "POST",
|
|
269
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}/stream-token",
|
|
270
|
+
body: body,
|
|
271
|
+
request_options: request_options
|
|
272
|
+
)
|
|
273
|
+
begin
|
|
274
|
+
response = @client.send(request)
|
|
275
|
+
rescue Net::HTTPRequestTimeout
|
|
276
|
+
raise Pinnacle::Errors::TimeoutError
|
|
277
|
+
end
|
|
278
|
+
code = response.code.to_i
|
|
279
|
+
if code.between?(200, 299)
|
|
280
|
+
Pinnacle::Types::CallStreamToken.load(response.body)
|
|
281
|
+
else
|
|
282
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
283
|
+
raise error_class.new(response.body, code: code)
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Return a short-lived signed URL for the call recording.
|
|
288
|
+
#
|
|
289
|
+
# @param request_options [Hash]
|
|
290
|
+
# @param params [Hash]
|
|
291
|
+
# @option request_options [String] :base_url
|
|
292
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
293
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
294
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
295
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
296
|
+
# @option params [String] :id
|
|
297
|
+
# @option params [Integer, nil] :expires_in
|
|
298
|
+
#
|
|
299
|
+
# @return [Pinnacle::Types::RecordingDownload]
|
|
300
|
+
def download_recording(request_options: {}, **params)
|
|
301
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
302
|
+
query_params = {}
|
|
303
|
+
query_params["expires_in"] = params[:expires_in] if params.key?(:expires_in)
|
|
304
|
+
|
|
305
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
306
|
+
base_url: request_options[:base_url],
|
|
307
|
+
method: "GET",
|
|
308
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}/recording",
|
|
309
|
+
query: query_params,
|
|
310
|
+
request_options: request_options
|
|
311
|
+
)
|
|
312
|
+
begin
|
|
313
|
+
response = @client.send(request)
|
|
314
|
+
rescue Net::HTTPRequestTimeout
|
|
315
|
+
raise Pinnacle::Errors::TimeoutError
|
|
316
|
+
end
|
|
317
|
+
code = response.code.to_i
|
|
318
|
+
if code.between?(200, 299)
|
|
319
|
+
Pinnacle::Types::RecordingDownload.load(response.body)
|
|
320
|
+
else
|
|
321
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
322
|
+
raise error_class.new(response.body, code: code)
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Delete the canonical recording and queued fragments for a terminal call.
|
|
327
|
+
#
|
|
328
|
+
# @param request_options [Hash]
|
|
329
|
+
# @param params [Hash]
|
|
330
|
+
# @option request_options [String] :base_url
|
|
331
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
332
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
333
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
334
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
335
|
+
# @option params [String] :id
|
|
336
|
+
#
|
|
337
|
+
# @return [untyped]
|
|
338
|
+
def delete_recording(request_options: {}, **params)
|
|
339
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
340
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
341
|
+
base_url: request_options[:base_url],
|
|
342
|
+
method: "DELETE",
|
|
343
|
+
path: "calls/#{URI.encode_uri_component(params[:id].to_s)}/recording",
|
|
344
|
+
request_options: request_options
|
|
345
|
+
)
|
|
346
|
+
begin
|
|
347
|
+
response = @client.send(request)
|
|
348
|
+
rescue Net::HTTPRequestTimeout
|
|
349
|
+
raise Pinnacle::Errors::TimeoutError
|
|
350
|
+
end
|
|
351
|
+
code = response.code.to_i
|
|
352
|
+
return if code.between?(200, 299)
|
|
353
|
+
|
|
354
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
355
|
+
raise error_class.new(response.body, code: code)
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class CallsDownloadRecordingRequest < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :expires_in, -> { Integer }, optional: true, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class CallsListEventsRequest < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :cursor, -> { String }, optional: true, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class CallsListRequest < Internal::Types::Model
|
|
7
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :cursor, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :state, -> { Pinnacle::Types::CallState }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :direction, -> { Pinnacle::Types::CallDirection }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :from, -> { String }, optional: true, nullable: false
|
|
16
|
+
|
|
17
|
+
field :to, -> { String }, optional: true, nullable: false
|
|
18
|
+
|
|
19
|
+
field :created_after, -> { String }, optional: true, nullable: false
|
|
20
|
+
|
|
21
|
+
field :created_before, -> { String }, optional: true, nullable: false
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class CreateCallParams < Internal::Types::Model
|
|
7
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :record, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :metadata, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class CreateStreamTokenParams < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :commands_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :stream_id, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :record, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Calls
|
|
5
|
+
module Types
|
|
6
|
+
class UpdateCallParams < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :metadata, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/pinnacle/client.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Pinnacle
|
|
|
10
10
|
@raw_client = Pinnacle::Internal::Http::RawClient.new(
|
|
11
11
|
base_url: base_url || Pinnacle::Environment::DEFAULT,
|
|
12
12
|
headers: {
|
|
13
|
-
"User-Agent" => "rcs/2.0.
|
|
13
|
+
"User-Agent" => "rcs/2.0.20.pre.rc.1",
|
|
14
14
|
"X-Fern-Language" => "Ruby",
|
|
15
15
|
"PINNACLE-API-KEY" => api_key.to_s
|
|
16
16
|
}
|
|
@@ -57,6 +57,11 @@ module Pinnacle
|
|
|
57
57
|
@webhooks ||= Pinnacle::Webhooks::Client.new(client: @raw_client)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# @return [Pinnacle::Calls::Client]
|
|
61
|
+
def calls
|
|
62
|
+
@calls ||= Pinnacle::Calls::Client.new(client: @raw_client)
|
|
63
|
+
end
|
|
64
|
+
|
|
60
65
|
# @return [Pinnacle::Forms::Client]
|
|
61
66
|
def forms
|
|
62
67
|
@forms ||= Pinnacle::Forms::Client.new(client: @raw_client)
|
|
@@ -67,6 +72,11 @@ module Pinnacle
|
|
|
67
72
|
@campaigns ||= Pinnacle::Campaigns::Client.new(client: @raw_client)
|
|
68
73
|
end
|
|
69
74
|
|
|
75
|
+
# @return [Pinnacle::Network::Client]
|
|
76
|
+
def network
|
|
77
|
+
@network ||= Pinnacle::Network::Client.new(client: @raw_client)
|
|
78
|
+
end
|
|
79
|
+
|
|
70
80
|
# @return [Pinnacle::Status::Client]
|
|
71
81
|
def status
|
|
72
82
|
@status ||= Pinnacle::Status::Client.new(client: @raw_client)
|
|
@@ -174,7 +174,7 @@ module Pinnacle
|
|
|
174
174
|
# for embedding the URL in your own outreach.
|
|
175
175
|
#
|
|
176
176
|
# On completion, a `FORM.SUBMISSION` webhook event is delivered to webhooks subscribed to the sender. See
|
|
177
|
-
# [Receiving
|
|
177
|
+
# [Receiving Message, Call, and User Events](/guides/messages/receiving).
|
|
178
178
|
#
|
|
179
179
|
# @param request_options [Hash]
|
|
180
180
|
# @param params [Pinnacle::Types::SendFormParams]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
class Client
|
|
6
|
+
# @param client [Pinnacle::Internal::Http::RawClient]
|
|
7
|
+
#
|
|
8
|
+
# @return [void]
|
|
9
|
+
def initialize(client:)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @return [Pinnacle::SimSwap::Client]
|
|
14
|
+
def sim_swap
|
|
15
|
+
@sim_swap ||= Pinnacle::Network::SimSwap::Client.new(client: @client)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @return [Pinnacle::SubscriberMatch::Client]
|
|
19
|
+
def subscriber_match
|
|
20
|
+
@subscriber_match ||= Pinnacle::Network::SubscriberMatch::Client.new(client: @client)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @return [Pinnacle::SilentAuth::Client]
|
|
24
|
+
def silent_auth
|
|
25
|
+
@silent_auth ||= Pinnacle::Network::SilentAuth::Client.new(client: @client)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# @return [Pinnacle::Requests::Client]
|
|
29
|
+
def requests
|
|
30
|
+
@requests ||= Pinnacle::Network::Requests::Client.new(client: @client)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module Requests
|
|
6
|
+
class Client
|
|
7
|
+
# @param client [Pinnacle::Internal::Http::RawClient]
|
|
8
|
+
#
|
|
9
|
+
# @return [void]
|
|
10
|
+
def initialize(client:)
|
|
11
|
+
@client = client
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# List Network API request records for your team, sorted newest first. Use filters to audit recent checks by
|
|
15
|
+
# type, status, or your own `clientRef`.
|
|
16
|
+
#
|
|
17
|
+
# <Note>
|
|
18
|
+
# Limited availability. Contact [founders@pinnacle.sh](mailto:founders@pinnacle.sh) to request access.
|
|
19
|
+
# </Note>
|
|
20
|
+
#
|
|
21
|
+
# @param request_options [Hash]
|
|
22
|
+
# @param params [Pinnacle::Network::Requests::Types::ListNetworkRequestsParams]
|
|
23
|
+
# @option request_options [String] :base_url
|
|
24
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
25
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
26
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
27
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
28
|
+
#
|
|
29
|
+
# @return [Pinnacle::Types::ListNetworkRequestsResponse]
|
|
30
|
+
def list(request_options: {}, **params)
|
|
31
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
32
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
33
|
+
base_url: request_options[:base_url],
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "network/requests/list",
|
|
36
|
+
body: Pinnacle::Network::Requests::Types::ListNetworkRequestsParams.new(params).to_h,
|
|
37
|
+
request_options: request_options
|
|
38
|
+
)
|
|
39
|
+
begin
|
|
40
|
+
response = @client.send(request)
|
|
41
|
+
rescue Net::HTTPRequestTimeout
|
|
42
|
+
raise Pinnacle::Errors::TimeoutError
|
|
43
|
+
end
|
|
44
|
+
code = response.code.to_i
|
|
45
|
+
if code.between?(200, 299)
|
|
46
|
+
Pinnacle::Types::ListNetworkRequestsResponse.load(response.body)
|
|
47
|
+
else
|
|
48
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
49
|
+
raise error_class.new(response.body, code: code)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Retrieve one Network API request by ID. The response includes lifecycle timestamps, request status, your
|
|
54
|
+
# `clientRef`, and result fields from the original check.
|
|
55
|
+
#
|
|
56
|
+
# <Note>
|
|
57
|
+
# Limited availability. Contact [founders@pinnacle.sh](mailto:founders@pinnacle.sh) to request access.
|
|
58
|
+
# </Note>
|
|
59
|
+
#
|
|
60
|
+
# @param request_options [Hash]
|
|
61
|
+
# @param params [Hash]
|
|
62
|
+
# @option request_options [String] :base_url
|
|
63
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
64
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
65
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
66
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
67
|
+
# @option params [Pinnacle::Types::NetworkRequestId] :request_id
|
|
68
|
+
#
|
|
69
|
+
# @return [Pinnacle::Types::NetworkRequestSummary]
|
|
70
|
+
def get(request_options: {}, **params)
|
|
71
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
72
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
73
|
+
base_url: request_options[:base_url],
|
|
74
|
+
method: "GET",
|
|
75
|
+
path: "network/requests/#{URI.encode_uri_component(params[:request_id].to_s)}",
|
|
76
|
+
request_options: request_options
|
|
77
|
+
)
|
|
78
|
+
begin
|
|
79
|
+
response = @client.send(request)
|
|
80
|
+
rescue Net::HTTPRequestTimeout
|
|
81
|
+
raise Pinnacle::Errors::TimeoutError
|
|
82
|
+
end
|
|
83
|
+
code = response.code.to_i
|
|
84
|
+
if code.between?(200, 299)
|
|
85
|
+
Pinnacle::Types::NetworkRequestSummary.load(response.body)
|
|
86
|
+
else
|
|
87
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
88
|
+
raise error_class.new(response.body, code: code)
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|