rcs 2.0.20 → 2.0.22.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 +2 -2
- data/.fern/replay.lock +7 -1
- data/.fernignore +2 -0
- data/CONTRIBUTING.md +8 -12
- data/README.md +1 -1
- data/lib/pinnacle/calls/client.rb +386 -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 +19 -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/campaigns/dlc/client.rb +1 -1
- data/lib/pinnacle/campaigns/rcs/client.rb +1 -1
- data/lib/pinnacle/campaigns/toll_free/client.rb +1 -1
- data/lib/pinnacle/client.rb +29 -14
- data/lib/pinnacle/conferences/client.rb +212 -0
- data/lib/pinnacle/conferences/participants/client.rb +209 -0
- data/lib/pinnacle/conferences/participants/types/participants_add_request.rb +17 -0
- data/lib/pinnacle/conferences/participants/types/update_conference_participant_params.rb +23 -0
- data/lib/pinnacle/conferences/types/conferences_list_request.rb +13 -0
- data/lib/pinnacle/conferences/types/create_conference_params.rb +23 -0
- data/lib/pinnacle/conferences/types/update_conference_params.rb +19 -0
- data/lib/pinnacle/forms/client.rb +1 -1
- data/lib/pinnacle/messages/blast/types/blast_rcs_options.rb +2 -0
- data/lib/pinnacle/messages/blast/types/blast_rcs_request_options_card_width.rb +16 -0
- 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/types/add_conference_participant_params.rb +15 -0
- data/lib/pinnacle/types/agent_summary_carrier_launches.rb +1 -1
- data/lib/pinnacle/types/call.rb +35 -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/conference.rb +33 -0
- data/lib/pinnacle/types/conference_ended_reason.rb +16 -0
- data/lib/pinnacle/types/conference_participant.rb +34 -0
- data/lib/pinnacle/types/conference_status.rb +13 -0
- data/lib/pinnacle/types/created_call.rb +33 -0
- data/lib/pinnacle/types/dial.rb +30 -0
- data/lib/pinnacle/types/e_164_phone_number.rb +23 -0
- data/lib/pinnacle/types/existing_call_participant_params.rb +20 -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_conferences_response.rb +9 -0
- data/lib/pinnacle/types/list_network_requests_response.rb +13 -0
- data/lib/pinnacle/types/list_participants_response.rb +9 -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/participant_announce.rb +15 -0
- data/lib/pinnacle/types/participant_label.rb +23 -0
- data/lib/pinnacle/types/participant_left_reason.rb +17 -0
- data/lib/pinnacle/types/participant_status.rb +15 -0
- data/lib/pinnacle/types/play.rb +9 -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/speak.rb +11 -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/types/whisper_to.rb +23 -0
- data/lib/pinnacle/version.rb +1 -1
- data/lib/pinnacle.rb +145 -72
- metadata +75 -2
|
@@ -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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module Requests
|
|
6
|
+
module Types
|
|
7
|
+
class ListNetworkRequestsParams < Internal::Types::Model
|
|
8
|
+
field :page_index, -> { Integer }, optional: true, nullable: false, api_name: "pageIndex"
|
|
9
|
+
|
|
10
|
+
field :page_size, -> { Integer }, optional: true, nullable: false, api_name: "pageSize"
|
|
11
|
+
|
|
12
|
+
field :type, -> { Pinnacle::Types::NetworkRequestType }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :status, -> { Pinnacle::Types::NetworkRequestStatus }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :client_ref, -> { String }, optional: true, nullable: false, api_name: "clientRef"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SilentAuth
|
|
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
|
+
# Start a Silent Authentication session to verify that the user controls the device attached to a phone number.
|
|
15
|
+
# Omit `format` to receive a `browserUrl` for the hosted browser/WebView flow, or set `format: "json"` to
|
|
16
|
+
# receive a `jsonUrl` for a native mobile app or custom client-side flow. The device check must run from the
|
|
17
|
+
# user's cellular device, not your server.
|
|
18
|
+
#
|
|
19
|
+
# The returned URL expires 60 seconds after creation. Open or fetch it immediately and use `expiresAt` to detect
|
|
20
|
+
# when a new Silent Auth session is required.
|
|
21
|
+
#
|
|
22
|
+
# <Note>
|
|
23
|
+
# Limited availability. Contact [founders@pinnacle.sh](mailto:founders@pinnacle.sh) to request access.
|
|
24
|
+
# </Note>
|
|
25
|
+
#
|
|
26
|
+
# @param request_options [Hash]
|
|
27
|
+
# @param params [Pinnacle::Network::SilentAuth::Types::SilentAuthRequest]
|
|
28
|
+
# @option request_options [String] :base_url
|
|
29
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
30
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
31
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
32
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
33
|
+
#
|
|
34
|
+
# @return [Pinnacle::Types::SilentAuthResponse]
|
|
35
|
+
def start(request_options: {}, **params)
|
|
36
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
37
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
38
|
+
base_url: request_options[:base_url],
|
|
39
|
+
method: "POST",
|
|
40
|
+
path: "network/silent-auth",
|
|
41
|
+
body: Pinnacle::Network::SilentAuth::Types::SilentAuthRequest.new(params).to_h,
|
|
42
|
+
request_options: request_options
|
|
43
|
+
)
|
|
44
|
+
begin
|
|
45
|
+
response = @client.send(request)
|
|
46
|
+
rescue Net::HTTPRequestTimeout
|
|
47
|
+
raise Pinnacle::Errors::TimeoutError
|
|
48
|
+
end
|
|
49
|
+
code = response.code.to_i
|
|
50
|
+
if code.between?(200, 299)
|
|
51
|
+
Pinnacle::Types::SilentAuthResponse.load(response.body)
|
|
52
|
+
else
|
|
53
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
54
|
+
raise error_class.new(response.body, code: code)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Complete a Silent Authentication request by exchanging the code returned from the JSON flow. Call this from
|
|
59
|
+
# your server after the user's mobile app fetches `jsonUrl`.
|
|
60
|
+
#
|
|
61
|
+
# This endpoint returns a terminal verification result. To inspect pending lifecycle states such as `started` or
|
|
62
|
+
# `challenge-issued`, use [Get Network Request](/api-reference/network/get-network-request).
|
|
63
|
+
#
|
|
64
|
+
# <Note>
|
|
65
|
+
# Limited availability. Contact [founders@pinnacle.sh](mailto:founders@pinnacle.sh) to request access.
|
|
66
|
+
# </Note>
|
|
67
|
+
#
|
|
68
|
+
# @param request_options [Hash]
|
|
69
|
+
# @param params [Pinnacle::Network::SilentAuth::Types::SilentAuthCheckRequest]
|
|
70
|
+
# @option request_options [String] :base_url
|
|
71
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
72
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
73
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
74
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
75
|
+
# @option params [Pinnacle::Types::NetworkRequestId] :request_id
|
|
76
|
+
#
|
|
77
|
+
# @return [Pinnacle::Types::SilentAuthCheckResponse]
|
|
78
|
+
def check(request_options: {}, **params)
|
|
79
|
+
params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
|
|
80
|
+
request_data = Pinnacle::Network::SilentAuth::Types::SilentAuthCheckRequest.new(params).to_h
|
|
81
|
+
non_body_param_names = %w[requestId]
|
|
82
|
+
body = request_data.except(*non_body_param_names)
|
|
83
|
+
|
|
84
|
+
request = Pinnacle::Internal::JSON::Request.new(
|
|
85
|
+
base_url: request_options[:base_url],
|
|
86
|
+
method: "POST",
|
|
87
|
+
path: "network/silent-auth/#{URI.encode_uri_component(params[:request_id].to_s)}/check",
|
|
88
|
+
body: body,
|
|
89
|
+
request_options: request_options
|
|
90
|
+
)
|
|
91
|
+
begin
|
|
92
|
+
response = @client.send(request)
|
|
93
|
+
rescue Net::HTTPRequestTimeout
|
|
94
|
+
raise Pinnacle::Errors::TimeoutError
|
|
95
|
+
end
|
|
96
|
+
code = response.code.to_i
|
|
97
|
+
if code.between?(200, 299)
|
|
98
|
+
Pinnacle::Types::SilentAuthCheckResponse.load(response.body)
|
|
99
|
+
else
|
|
100
|
+
error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
|
|
101
|
+
raise error_class.new(response.body, code: code)
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SilentAuth
|
|
6
|
+
module Types
|
|
7
|
+
class SilentAuthCheckRequest < Internal::Types::Model
|
|
8
|
+
field :request_id, -> { String }, optional: false, nullable: false, api_name: "requestId"
|
|
9
|
+
|
|
10
|
+
field :code, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SilentAuth
|
|
6
|
+
module Types
|
|
7
|
+
class SilentAuthRequest < Internal::Types::Model
|
|
8
|
+
field :phone_number, -> { String }, optional: false, nullable: false, api_name: "phoneNumber"
|
|
9
|
+
|
|
10
|
+
field :client_ref, -> { String }, optional: true, nullable: false, api_name: "clientRef"
|
|
11
|
+
|
|
12
|
+
field :format, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SimSwap
|
|
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
|
+
# Check whether a phone number's SIM was changed during a recent lookback window. Use this to flag account
|
|
15
|
+
# takeover risk before sign-in, password reset, payment, or other sensitive actions.
|
|
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::SimSwap::Types::SimSwapRequest]
|
|
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::SimSwapResponse]
|
|
30
|
+
def check(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/sim-swap",
|
|
36
|
+
body: Pinnacle::Network::SimSwap::Types::SimSwapRequest.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::SimSwapResponse.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
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SimSwap
|
|
6
|
+
module Types
|
|
7
|
+
class SimSwapRequest < Internal::Types::Model
|
|
8
|
+
field :phone_number, -> { String }, optional: false, nullable: false, api_name: "phoneNumber"
|
|
9
|
+
|
|
10
|
+
field :period_hours, -> { Integer }, optional: true, nullable: false, api_name: "periodHours"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SubscriberMatch
|
|
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
|
+
# Compare user-provided identity details against the carrier's subscriber record. Results return match strength
|
|
15
|
+
# per attribute, so you can use partial signals without receiving carrier PII.
|
|
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::SubscriberMatch::Types::SubscriberMatchRequest]
|
|
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::SubscriberMatchResponse]
|
|
30
|
+
def check(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/subscriber-match",
|
|
36
|
+
body: Pinnacle::Network::SubscriberMatch::Types::SubscriberMatchRequest.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::SubscriberMatchResponse.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
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Network
|
|
5
|
+
module SubscriberMatch
|
|
6
|
+
module Types
|
|
7
|
+
class SubscriberMatchRequest < Internal::Types::Model
|
|
8
|
+
field :phone_number, -> { String }, optional: false, nullable: false, api_name: "phoneNumber"
|
|
9
|
+
|
|
10
|
+
field :attributes, -> { Pinnacle::Types::SubscriberMatchAttributes }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# Either dial someone (`to` + `from`) or pull in an existing call (`call_id`). `muted` and `whisper_to` can't be
|
|
6
|
+
# combined.
|
|
7
|
+
class AddConferenceParticipantParams < Internal::Types::Model
|
|
8
|
+
extend Pinnacle::Internal::Types::Union
|
|
9
|
+
|
|
10
|
+
member -> { Pinnacle::Types::Dial }
|
|
11
|
+
|
|
12
|
+
member -> { Pinnacle::Types::ExistingCallParticipantParams }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -5,7 +5,7 @@ module Pinnacle
|
|
|
5
5
|
# Raw per-carrier launch + verification state for the agent. Each
|
|
6
6
|
# value is tri-state — `null` means "no launch requested" or "not
|
|
7
7
|
# sent yet"; `false` means "pending" / "sent"; `true` means
|
|
8
|
-
# "launched" / "verified". Use the [GET /rcs/{agentId}](/api-reference/rcs-agents/get)
|
|
8
|
+
# "launched" / "verified". Use the [GET /rcs/{agentId}](/api-reference/rcs-agents/get-agent)
|
|
9
9
|
# endpoint for the resolved enum representation.
|
|
10
10
|
class AgentSummaryCarrierLaunches < Internal::Types::Model
|
|
11
11
|
field :att, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "ATT"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
class Call < Internal::Types::Model
|
|
6
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :state, -> { Pinnacle::Types::CallState }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :direction, -> { Pinnacle::Types::CallDirection }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :created_at, -> { String }, optional: false, nullable: false
|
|
17
|
+
|
|
18
|
+
field :started_at, -> { String }, optional: false, nullable: true
|
|
19
|
+
|
|
20
|
+
field :answered_at, -> { String }, optional: false, nullable: true
|
|
21
|
+
|
|
22
|
+
field :ended_at, -> { String }, optional: false, nullable: true
|
|
23
|
+
|
|
24
|
+
field :metadata, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false
|
|
25
|
+
|
|
26
|
+
field :record, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
27
|
+
|
|
28
|
+
field :recording_state, -> { Pinnacle::Types::RecordingState }, optional: false, nullable: true
|
|
29
|
+
|
|
30
|
+
field :hangup_cause, -> { String }, optional: false, nullable: true
|
|
31
|
+
|
|
32
|
+
field :conference_id, -> { String }, optional: true, nullable: false
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
class CallEvent < Internal::Types::Model
|
|
6
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :call_session_id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :event_type, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :source, -> { Pinnacle::Types::CallEventSource }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :direction, -> { Pinnacle::Types::CallDirection }, optional: false, nullable: true
|
|
15
|
+
|
|
16
|
+
field :command_id, -> { String }, optional: false, nullable: true
|
|
17
|
+
|
|
18
|
+
field :latency_ms, -> { Integer }, optional: false, nullable: true
|
|
19
|
+
|
|
20
|
+
field :occurred_at, -> { String }, optional: false, nullable: false
|
|
21
|
+
|
|
22
|
+
field :received_at, -> { String }, optional: false, nullable: false
|
|
23
|
+
|
|
24
|
+
field :payload, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
module CallMetadata
|
|
6
|
+
# CallMetadata is an alias for Hash
|
|
7
|
+
|
|
8
|
+
# @option str [String]
|
|
9
|
+
#
|
|
10
|
+
# @return [untyped]
|
|
11
|
+
def self.load(str)
|
|
12
|
+
::JSON.parse(str)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @option value [untyped]
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
def self.dump(value)
|
|
19
|
+
::JSON.generate(value)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
module CallState
|
|
6
|
+
extend Pinnacle::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
INITIATED = "INITIATED"
|
|
9
|
+
RINGING = "RINGING"
|
|
10
|
+
ANSWERED = "ANSWERED"
|
|
11
|
+
BRIDGED = "BRIDGED"
|
|
12
|
+
ENDED = "ENDED"
|
|
13
|
+
FAILED = "FAILED"
|
|
14
|
+
NO_ANSWER = "NO_ANSWER"
|
|
15
|
+
BUSY = "BUSY"
|
|
16
|
+
CANCELED = "CANCELED"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# Voice call lifecycle update delivered to webhooks attached to a phone number.
|
|
6
|
+
class CallStatusEvent < Internal::Types::Model
|
|
7
|
+
field :type, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :sender, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :call, -> { Pinnacle::Types::CallStatusEventCall }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
class CallStatusEventCall < Internal::Types::Model
|
|
6
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :direction, -> { Pinnacle::Types::CallDirection }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :status, -> { Pinnacle::Types::CallState }, optional: false, nullable: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
class CallStreamToken < Internal::Types::Model
|
|
6
|
+
field :token, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :expires_at, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :stream_url, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
class Conference < Internal::Types::Model
|
|
6
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :label, -> { String }, optional: false, nullable: true
|
|
9
|
+
|
|
10
|
+
field :status, -> { Pinnacle::Types::ConferenceStatus }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :participant_count, -> { Integer }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :max_participants, -> { Integer }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :hold_audio_url, -> { String }, optional: false, nullable: true
|
|
17
|
+
|
|
18
|
+
field :speaking_events, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
19
|
+
|
|
20
|
+
field :metadata, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false
|
|
21
|
+
|
|
22
|
+
field :created_at, -> { String }, optional: false, nullable: false
|
|
23
|
+
|
|
24
|
+
field :started_at, -> { String }, optional: false, nullable: true
|
|
25
|
+
|
|
26
|
+
field :ended_at, -> { String }, optional: false, nullable: true
|
|
27
|
+
|
|
28
|
+
field :ended_reason, -> { Pinnacle::Types::ConferenceEndedReason }, optional: false, nullable: true
|
|
29
|
+
|
|
30
|
+
field :participants, -> { Internal::Types::Array[Pinnacle::Types::ConferenceParticipant] }, optional: false, nullable: false
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
module ConferenceEndedReason
|
|
6
|
+
extend Pinnacle::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
EMPTY = "empty"
|
|
9
|
+
ENDED_BY_API = "ended_by_api"
|
|
10
|
+
PARTICIPANT_ENDED_IT = "participant_ended_it"
|
|
11
|
+
TIME_LIMIT = "time_limit"
|
|
12
|
+
EXPIRED_WAITING = "expired_waiting"
|
|
13
|
+
FAILED = "failed"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|