rcs 2.0.21 → 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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.fernignore +2 -0
  3. data/CONTRIBUTING.md +8 -12
  4. data/README.md +1 -1
  5. data/lib/pinnacle/calls/client.rb +386 -0
  6. data/lib/pinnacle/calls/types/calls_download_recording_request.rb +13 -0
  7. data/lib/pinnacle/calls/types/calls_list_events_request.rb +15 -0
  8. data/lib/pinnacle/calls/types/calls_list_request.rb +25 -0
  9. data/lib/pinnacle/calls/types/create_call_params.rb +19 -0
  10. data/lib/pinnacle/calls/types/create_stream_token_params.rb +17 -0
  11. data/lib/pinnacle/calls/types/update_call_params.rb +13 -0
  12. data/lib/pinnacle/campaigns/dlc/client.rb +1 -1
  13. data/lib/pinnacle/campaigns/rcs/client.rb +1 -1
  14. data/lib/pinnacle/campaigns/toll_free/client.rb +1 -1
  15. data/lib/pinnacle/client.rb +29 -14
  16. data/lib/pinnacle/conferences/client.rb +212 -0
  17. data/lib/pinnacle/conferences/participants/client.rb +209 -0
  18. data/lib/pinnacle/conferences/participants/types/participants_add_request.rb +17 -0
  19. data/lib/pinnacle/conferences/participants/types/update_conference_participant_params.rb +23 -0
  20. data/lib/pinnacle/conferences/types/conferences_list_request.rb +13 -0
  21. data/lib/pinnacle/conferences/types/create_conference_params.rb +23 -0
  22. data/lib/pinnacle/conferences/types/update_conference_params.rb +19 -0
  23. data/lib/pinnacle/forms/client.rb +1 -1
  24. data/lib/pinnacle/network/client.rb +34 -0
  25. data/lib/pinnacle/network/requests/client.rb +94 -0
  26. data/lib/pinnacle/network/requests/types/list_network_requests_params.rb +21 -0
  27. data/lib/pinnacle/network/silent_auth/client.rb +107 -0
  28. data/lib/pinnacle/network/silent_auth/types/silent_auth_check_request.rb +15 -0
  29. data/lib/pinnacle/network/silent_auth/types/silent_auth_request.rb +17 -0
  30. data/lib/pinnacle/network/sim_swap/client.rb +55 -0
  31. data/lib/pinnacle/network/sim_swap/types/sim_swap_request.rb +15 -0
  32. data/lib/pinnacle/network/subscriber_match/client.rb +55 -0
  33. data/lib/pinnacle/network/subscriber_match/types/subscriber_match_request.rb +15 -0
  34. data/lib/pinnacle/types/add_conference_participant_params.rb +15 -0
  35. data/lib/pinnacle/types/agent_summary_carrier_launches.rb +1 -1
  36. data/lib/pinnacle/types/call.rb +35 -0
  37. data/lib/pinnacle/types/call_direction.rb +12 -0
  38. data/lib/pinnacle/types/call_event.rb +27 -0
  39. data/lib/pinnacle/types/call_event_source.rb +14 -0
  40. data/lib/pinnacle/types/call_metadata.rb +23 -0
  41. data/lib/pinnacle/types/call_state.rb +19 -0
  42. data/lib/pinnacle/types/call_status_event.rb +14 -0
  43. data/lib/pinnacle/types/call_status_event_call.rb +17 -0
  44. data/lib/pinnacle/types/call_stream_token.rb +13 -0
  45. data/lib/pinnacle/types/conference.rb +33 -0
  46. data/lib/pinnacle/types/conference_ended_reason.rb +16 -0
  47. data/lib/pinnacle/types/conference_participant.rb +34 -0
  48. data/lib/pinnacle/types/conference_status.rb +13 -0
  49. data/lib/pinnacle/types/created_call.rb +33 -0
  50. data/lib/pinnacle/types/dial.rb +30 -0
  51. data/lib/pinnacle/types/e_164_phone_number.rb +23 -0
  52. data/lib/pinnacle/types/existing_call_participant_params.rb +20 -0
  53. data/lib/pinnacle/types/hosted_silent_auth_response.rb +13 -0
  54. data/lib/pinnacle/types/json_silent_auth_response.rb +13 -0
  55. data/lib/pinnacle/types/list_call_events_response.rb +11 -0
  56. data/lib/pinnacle/types/list_calls_response.rb +11 -0
  57. data/lib/pinnacle/types/list_conferences_response.rb +9 -0
  58. data/lib/pinnacle/types/list_network_requests_response.rb +13 -0
  59. data/lib/pinnacle/types/list_participants_response.rb +9 -0
  60. data/lib/pinnacle/types/network_insight_status.rb +14 -0
  61. data/lib/pinnacle/types/network_request_id.rb +23 -0
  62. data/lib/pinnacle/types/network_request_result.rb +16 -0
  63. data/lib/pinnacle/types/network_request_status.rb +15 -0
  64. data/lib/pinnacle/types/network_request_summary.rb +27 -0
  65. data/lib/pinnacle/types/network_request_type.rb +13 -0
  66. data/lib/pinnacle/types/participant_announce.rb +15 -0
  67. data/lib/pinnacle/types/participant_label.rb +23 -0
  68. data/lib/pinnacle/types/participant_left_reason.rb +17 -0
  69. data/lib/pinnacle/types/participant_status.rb +15 -0
  70. data/lib/pinnacle/types/play.rb +9 -0
  71. data/lib/pinnacle/types/recording_download.rb +11 -0
  72. data/lib/pinnacle/types/recording_state.rb +14 -0
  73. data/lib/pinnacle/types/silent_auth_check_response.rb +11 -0
  74. data/lib/pinnacle/types/silent_auth_check_response_status.rb +12 -0
  75. data/lib/pinnacle/types/silent_auth_response.rb +15 -0
  76. data/lib/pinnacle/types/sim_swap_response.rb +15 -0
  77. data/lib/pinnacle/types/speak.rb +11 -0
  78. data/lib/pinnacle/types/subscriber_match_attributes.rb +30 -0
  79. data/lib/pinnacle/types/subscriber_match_response.rb +13 -0
  80. data/lib/pinnacle/types/subscriber_match_response_matches.rb +41 -0
  81. data/lib/pinnacle/types/subscriber_match_result.rb +18 -0
  82. data/lib/pinnacle/types/webhook_event_enum.rb +1 -0
  83. data/lib/pinnacle/types/whisper_to.rb +23 -0
  84. data/lib/pinnacle/version.rb +1 -1
  85. data/lib/pinnacle.rb +144 -72
  86. metadata +74 -2
@@ -10,21 +10,31 @@ 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.21",
13
+ "User-Agent" => "rcs/2.0.22.pre.rc.1",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "PINNACLE-API-KEY" => api_key.to_s
16
16
  }
17
17
  )
18
18
  end
19
19
 
20
+ # @return [Pinnacle::Audiences::Client]
21
+ def audiences
22
+ @audiences ||= Pinnacle::Audiences::Client.new(client: @raw_client)
23
+ end
24
+
20
25
  # @return [Pinnacle::Brands::Client]
21
26
  def brands
22
27
  @brands ||= Pinnacle::Brands::Client.new(client: @raw_client)
23
28
  end
24
29
 
25
- # @return [Pinnacle::Audiences::Client]
26
- def audiences
27
- @audiences ||= Pinnacle::Audiences::Client.new(client: @raw_client)
30
+ # @return [Pinnacle::Calls::Client]
31
+ def calls
32
+ @calls ||= Pinnacle::Calls::Client.new(client: @raw_client)
33
+ end
34
+
35
+ # @return [Pinnacle::Conferences::Client]
36
+ def conferences
37
+ @conferences ||= Pinnacle::Conferences::Client.new(client: @raw_client)
28
38
  end
29
39
 
30
40
  # @return [Pinnacle::Contacts::Client]
@@ -37,6 +47,16 @@ module Pinnacle
37
47
  @conversations ||= Pinnacle::Conversations::Client.new(client: @raw_client)
38
48
  end
39
49
 
50
+ # @return [Pinnacle::Faxes::Client]
51
+ def faxes
52
+ @faxes ||= Pinnacle::Faxes::Client.new(client: @raw_client)
53
+ end
54
+
55
+ # @return [Pinnacle::Forms::Client]
56
+ def forms
57
+ @forms ||= Pinnacle::Forms::Client.new(client: @raw_client)
58
+ end
59
+
40
60
  # @return [Pinnacle::Messages::Client]
41
61
  def messages
42
62
  @messages ||= Pinnacle::Messages::Client.new(client: @raw_client)
@@ -57,21 +77,16 @@ module Pinnacle
57
77
  @webhooks ||= Pinnacle::Webhooks::Client.new(client: @raw_client)
58
78
  end
59
79
 
60
- # @return [Pinnacle::Faxes::Client]
61
- def faxes
62
- @faxes ||= Pinnacle::Faxes::Client.new(client: @raw_client)
63
- end
64
-
65
- # @return [Pinnacle::Forms::Client]
66
- def forms
67
- @forms ||= Pinnacle::Forms::Client.new(client: @raw_client)
68
- end
69
-
70
80
  # @return [Pinnacle::Campaigns::Client]
71
81
  def campaigns
72
82
  @campaigns ||= Pinnacle::Campaigns::Client.new(client: @raw_client)
73
83
  end
74
84
 
85
+ # @return [Pinnacle::Network::Client]
86
+ def network
87
+ @network ||= Pinnacle::Network::Client.new(client: @raw_client)
88
+ end
89
+
75
90
  # @return [Pinnacle::Status::Client]
76
91
  def status
77
92
  @status ||= Pinnacle::Status::Client.new(client: @raw_client)
@@ -0,0 +1,212 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
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
+ # Your team's conferences, newest first, each with its participants.
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 [Pinnacle::Types::ConferenceStatus, nil] :status
24
+ #
25
+ # @return [Pinnacle::Types::ListConferencesResponse]
26
+ def list(request_options: {}, **params)
27
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
28
+ query_params = {}
29
+ query_params["limit"] = params[:limit] if params.key?(:limit)
30
+ query_params["status"] = params[:status] if params.key?(:status)
31
+
32
+ request = Pinnacle::Internal::JSON::Request.new(
33
+ base_url: request_options[:base_url],
34
+ method: "GET",
35
+ path: "conferences",
36
+ query: query_params,
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::ListConferencesResponse.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
+ # Create a conference: a room that calls can be added to. Each participant is an ordinary call.
54
+ #
55
+ # You can add participants in the same request. Existing calls are added first, so the conference is live before
56
+ # dialed participants answer. With no participants the conference is `waiting` until the first one joins.
57
+ #
58
+ # Send an `Idempotency-Key` to make dialed participants safe to retry: each one is dialed at most once.
59
+ #
60
+ # @param request_options [Hash]
61
+ # @param params [Pinnacle::Conferences::Types::CreateConferenceParams]
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 [String, nil] :idempotency_key
68
+ #
69
+ # @return [Pinnacle::Types::Conference]
70
+ def create(request_options: {}, **params)
71
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
72
+ request_data = Pinnacle::Conferences::Types::CreateConferenceParams.new(params).to_h
73
+ non_body_param_names = %w[Idempotency-Key]
74
+ body = request_data.except(*non_body_param_names)
75
+
76
+ headers = {}
77
+ headers["Idempotency-Key"] = params[:idempotency_key] if params[:idempotency_key]
78
+
79
+ request = Pinnacle::Internal::JSON::Request.new(
80
+ base_url: request_options[:base_url],
81
+ method: "POST",
82
+ path: "conferences",
83
+ headers: headers,
84
+ body: body,
85
+ request_options: request_options
86
+ )
87
+ begin
88
+ response = @client.send(request)
89
+ rescue Net::HTTPRequestTimeout
90
+ raise Pinnacle::Errors::TimeoutError
91
+ end
92
+ code = response.code.to_i
93
+ if code.between?(200, 299)
94
+ Pinnacle::Types::Conference.load(response.body)
95
+ else
96
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
97
+ raise error_class.new(response.body, code: code)
98
+ end
99
+ end
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::Conference]
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: "conferences/#{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::Conference.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 the conference and hang up every participant, including anyone still being dialed.
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::Conference]
145
+ def end_(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: "conferences/#{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::Conference.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
+ # Change the label, metadata, or hold audio. Only the fields you send change.
168
+ #
169
+ # @param request_options [Hash]
170
+ # @param params [Pinnacle::Conferences::Types::UpdateConferenceParams]
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::Conference]
179
+ def update(request_options: {}, **params)
180
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
181
+ request_data = Pinnacle::Conferences::Types::UpdateConferenceParams.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: "conferences/#{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::Conference.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
+ # @return [Pinnacle::Participants::Client]
207
+ def participants
208
+ @participants ||= Pinnacle::Conferences::Participants::Client.new(client: @client)
209
+ end
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,209 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Participants
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
+ # Everyone who has been in the conference, including people who left or never connected.
15
+ #
16
+ # @param request_options [Hash]
17
+ # @param params [Hash]
18
+ # @option request_options [String] :base_url
19
+ # @option request_options [Hash{String => Object}] :additional_headers
20
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
21
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
22
+ # @option request_options [Integer] :timeout_in_seconds
23
+ # @option params [String] :id
24
+ #
25
+ # @return [Pinnacle::Types::ListParticipantsResponse]
26
+ def list(request_options: {}, **params)
27
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
28
+ request = Pinnacle::Internal::JSON::Request.new(
29
+ base_url: request_options[:base_url],
30
+ method: "GET",
31
+ path: "conferences/#{URI.encode_uri_component(params[:id].to_s)}/participants",
32
+ request_options: request_options
33
+ )
34
+ begin
35
+ response = @client.send(request)
36
+ rescue Net::HTTPRequestTimeout
37
+ raise Pinnacle::Errors::TimeoutError
38
+ end
39
+ code = response.code.to_i
40
+ if code.between?(200, 299)
41
+ Pinnacle::Types::ListParticipantsResponse.load(response.body)
42
+ else
43
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
44
+ raise error_class.new(response.body, code: code)
45
+ end
46
+ end
47
+
48
+ # Add someone: dial a new number (`to` + `from`) or pull in a call you already have (`call_id`).
49
+ #
50
+ # A dialed participant is returned with status `dialing` and joins when they answer; you'll get
51
+ # `participant.joined` (or `participant.failed` if they don't answer). With `announce`, they hear it alone
52
+ # before joining.
53
+ #
54
+ # @param request_options [Hash]
55
+ # @param params [Pinnacle::Types::AddConferenceParticipantParams]
56
+ # @option request_options [String] :base_url
57
+ # @option request_options [Hash{String => Object}] :additional_headers
58
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
59
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
60
+ # @option request_options [Integer] :timeout_in_seconds
61
+ # @option params [String] :id
62
+ # @option params [String, nil] :idempotency_key
63
+ #
64
+ # @return [Pinnacle::Types::ConferenceParticipant]
65
+ def add(request_options: {}, **params)
66
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
67
+ path_param_names = %i[id]
68
+ body_params = params.except(*path_param_names)
69
+
70
+ headers = {}
71
+ headers["Idempotency-Key"] = params[:idempotency_key] if params[:idempotency_key]
72
+
73
+ request = Pinnacle::Internal::JSON::Request.new(
74
+ base_url: request_options[:base_url],
75
+ method: "POST",
76
+ path: "conferences/#{URI.encode_uri_component(params[:id].to_s)}/participants",
77
+ headers: headers,
78
+ body: Pinnacle::Types::AddConferenceParticipantParams.new(body_params).to_h,
79
+ request_options: request_options
80
+ )
81
+ begin
82
+ response = @client.send(request)
83
+ rescue Net::HTTPRequestTimeout
84
+ raise Pinnacle::Errors::TimeoutError
85
+ end
86
+ code = response.code.to_i
87
+ if code.between?(200, 299)
88
+ Pinnacle::Types::ConferenceParticipant.load(response.body)
89
+ else
90
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
91
+ raise error_class.new(response.body, code: code)
92
+ end
93
+ end
94
+
95
+ # @param request_options [Hash]
96
+ # @param params [Hash]
97
+ # @option request_options [String] :base_url
98
+ # @option request_options [Hash{String => Object}] :additional_headers
99
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
100
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
101
+ # @option request_options [Integer] :timeout_in_seconds
102
+ # @option params [String] :id
103
+ # @option params [String] :participant
104
+ #
105
+ # @return [Pinnacle::Types::ConferenceParticipant]
106
+ def get(request_options: {}, **params)
107
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
108
+ request = Pinnacle::Internal::JSON::Request.new(
109
+ base_url: request_options[:base_url],
110
+ method: "GET",
111
+ path: "conferences/#{URI.encode_uri_component(params[:id].to_s)}/participants/#{URI.encode_uri_component(params[:participant].to_s)}",
112
+ request_options: request_options
113
+ )
114
+ begin
115
+ response = @client.send(request)
116
+ rescue Net::HTTPRequestTimeout
117
+ raise Pinnacle::Errors::TimeoutError
118
+ end
119
+ code = response.code.to_i
120
+ if code.between?(200, 299)
121
+ Pinnacle::Types::ConferenceParticipant.load(response.body)
122
+ else
123
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
124
+ raise error_class.new(response.body, code: code)
125
+ end
126
+ end
127
+
128
+ # Hang up this participant's call. Everyone else stays in the conference.
129
+ #
130
+ # @param request_options [Hash]
131
+ # @param params [Hash]
132
+ # @option request_options [String] :base_url
133
+ # @option request_options [Hash{String => Object}] :additional_headers
134
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
135
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
136
+ # @option request_options [Integer] :timeout_in_seconds
137
+ # @option params [String] :id
138
+ # @option params [String] :participant
139
+ #
140
+ # @return [Pinnacle::Types::ConferenceParticipant]
141
+ def remove(request_options: {}, **params)
142
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
143
+ request = Pinnacle::Internal::JSON::Request.new(
144
+ base_url: request_options[:base_url],
145
+ method: "DELETE",
146
+ path: "conferences/#{URI.encode_uri_component(params[:id].to_s)}/participants/#{URI.encode_uri_component(params[:participant].to_s)}",
147
+ request_options: request_options
148
+ )
149
+ begin
150
+ response = @client.send(request)
151
+ rescue Net::HTTPRequestTimeout
152
+ raise Pinnacle::Errors::TimeoutError
153
+ end
154
+ code = response.code.to_i
155
+ if code.between?(200, 299)
156
+ Pinnacle::Types::ConferenceParticipant.load(response.body)
157
+ else
158
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
159
+ raise error_class.new(response.body, code: code)
160
+ end
161
+ end
162
+
163
+ # Mute, hold, or whisper. Only the fields you send change, and only real changes are applied.
164
+ #
165
+ # - `muted: true`: nobody hears them; they still hear everyone.
166
+ # - `on_hold: true`: they hear hold audio; nobody hears them.
167
+ # - `whisper_to: ["specialist"]`: only the specialist hears them. `null` goes back to everyone.
168
+ #
169
+ # @param request_options [Hash]
170
+ # @param params [Pinnacle::Conferences::Participants::Types::UpdateConferenceParticipantParams]
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
+ # @option params [String] :participant
178
+ #
179
+ # @return [Pinnacle::Types::ConferenceParticipant]
180
+ def update(request_options: {}, **params)
181
+ params = Pinnacle::Internal::Types::Utils.normalize_keys(params)
182
+ request_data = Pinnacle::Conferences::Participants::Types::UpdateConferenceParticipantParams.new(params).to_h
183
+ non_body_param_names = %w[id participant]
184
+ body = request_data.except(*non_body_param_names)
185
+
186
+ request = Pinnacle::Internal::JSON::Request.new(
187
+ base_url: request_options[:base_url],
188
+ method: "PATCH",
189
+ path: "conferences/#{URI.encode_uri_component(params[:id].to_s)}/participants/#{URI.encode_uri_component(params[:participant].to_s)}",
190
+ body: body,
191
+ request_options: request_options
192
+ )
193
+ begin
194
+ response = @client.send(request)
195
+ rescue Net::HTTPRequestTimeout
196
+ raise Pinnacle::Errors::TimeoutError
197
+ end
198
+ code = response.code.to_i
199
+ if code.between?(200, 299)
200
+ Pinnacle::Types::ConferenceParticipant.load(response.body)
201
+ else
202
+ error_class = Pinnacle::Errors::ResponseError.subclass_for_code(code)
203
+ raise error_class.new(response.body, code: code)
204
+ end
205
+ end
206
+ end
207
+ end
208
+ end
209
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Participants
6
+ module Types
7
+ class ParticipantsAddRequest < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :idempotency_key, -> { String }, optional: true, nullable: false, api_name: "Idempotency-Key"
11
+
12
+ field :body, -> { Pinnacle::Types::AddConferenceParticipantParams }, optional: false, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Participants
6
+ module Types
7
+ class UpdateConferenceParticipantParams < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :participant, -> { String }, optional: false, nullable: false
11
+
12
+ field :label, -> { String }, optional: true, nullable: false
13
+
14
+ field :muted, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
+
16
+ field :on_hold, -> { Internal::Types::Boolean }, optional: true, nullable: false
17
+
18
+ field :whisper_to, -> { Internal::Types::Array[String] }, optional: true, nullable: false
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Types
6
+ class ConferencesListRequest < Internal::Types::Model
7
+ field :limit, -> { Integer }, optional: true, nullable: false
8
+
9
+ field :status, -> { Pinnacle::Types::ConferenceStatus }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Types
6
+ class CreateConferenceParams < Internal::Types::Model
7
+ field :idempotency_key, -> { String }, optional: true, nullable: false, api_name: "Idempotency-Key"
8
+
9
+ field :label, -> { String }, optional: true, nullable: false
10
+
11
+ field :max_participants, -> { Integer }, optional: true, nullable: false
12
+
13
+ field :hold_audio_url, -> { String }, optional: true, nullable: false
14
+
15
+ field :speaking_events, -> { Internal::Types::Boolean }, optional: true, nullable: false
16
+
17
+ field :metadata, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
18
+
19
+ field :participants, -> { Internal::Types::Array[Pinnacle::Types::AddConferenceParticipantParams] }, optional: true, nullable: false
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Conferences
5
+ module Types
6
+ class UpdateConferenceParams < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :label, -> { String }, optional: true, nullable: false
10
+
11
+ field :hold_audio_url, -> { String }, optional: true, nullable: false
12
+
13
+ field :speaking_events, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+
15
+ field :metadata, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
16
+ end
17
+ end
18
+ end
19
+ end
@@ -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 Messages and User Events](/guides/messages/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