plex_ruby_sdk 0.7.6 → 0.8.0
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/lib/plex_ruby_sdk/activities.rb +115 -12
- data/lib/plex_ruby_sdk/authentication.rb +233 -29
- data/lib/plex_ruby_sdk/butler.rb +283 -30
- data/lib/plex_ruby_sdk/hubs.rb +174 -21
- data/lib/plex_ruby_sdk/library.rb +911 -152
- data/lib/plex_ruby_sdk/log.rb +179 -24
- data/lib/plex_ruby_sdk/media.rb +288 -35
- data/lib/plex_ruby_sdk/models/operations/collection.rb +3 -3
- data/lib/plex_ruby_sdk/models/operations/country.rb +10 -4
- data/lib/plex_ruby_sdk/models/operations/director.rb +3 -3
- data/lib/plex_ruby_sdk/models/operations/genre.rb +11 -4
- data/lib/plex_ruby_sdk/models/operations/get_all_media_library_genre.rb +2 -1
- data/lib/plex_ruby_sdk/models/operations/{getondeck_guids.rb → get_all_media_library_guids.rb} +3 -2
- data/lib/plex_ruby_sdk/models/operations/get_all_media_library_media.rb +8 -8
- data/lib/plex_ruby_sdk/models/operations/get_all_media_library_metadata.rb +6 -6
- data/lib/plex_ruby_sdk/models/operations/get_all_media_library_role.rb +1 -1
- data/lib/plex_ruby_sdk/models/operations/get_all_media_library_stream.rb +17 -11
- data/lib/plex_ruby_sdk/models/operations/get_library_items_media.rb +2 -2
- data/lib/plex_ruby_sdk/models/operations/get_library_items_metadata.rb +7 -7
- data/lib/plex_ruby_sdk/models/operations/get_media_meta_data_media.rb +8 -8
- data/lib/plex_ruby_sdk/models/operations/get_media_meta_data_metadata.rb +3 -3
- data/lib/plex_ruby_sdk/models/operations/get_media_meta_data_producer.rb +39 -0
- data/lib/plex_ruby_sdk/models/operations/get_media_meta_data_similar.rb +30 -0
- data/lib/plex_ruby_sdk/models/operations/get_media_meta_data_stream.rb +17 -11
- data/lib/plex_ruby_sdk/models/operations/get_recently_added_mediacontainer.rb +15 -15
- data/lib/plex_ruby_sdk/models/operations/get_recently_added_metadata.rb +119 -133
- data/lib/plex_ruby_sdk/models/operations/hasthumbnail.rb +1 -1
- data/lib/plex_ruby_sdk/models/operations/location.rb +3 -3
- data/lib/plex_ruby_sdk/models/operations/media.rb +27 -23
- data/lib/plex_ruby_sdk/models/operations/part.rb +23 -15
- data/lib/plex_ruby_sdk/models/operations/producer.rb +8 -11
- data/lib/plex_ruby_sdk/models/operations/{get_library_items_metadatarating.rb → rating.rb} +5 -5
- data/lib/plex_ruby_sdk/models/operations/role.rb +12 -12
- data/lib/plex_ruby_sdk/models/operations/similar.rb +4 -4
- data/lib/plex_ruby_sdk/models/operations/stream.rb +77 -44
- data/lib/plex_ruby_sdk/models/operations/writer.rb +15 -6
- data/lib/plex_ruby_sdk/models/operations.rb +18 -33
- data/lib/plex_ruby_sdk/playlists.rb +513 -60
- data/lib/plex_ruby_sdk/plex.rb +388 -38
- data/lib/plex_ruby_sdk/plex_api.rb +29 -10
- data/lib/plex_ruby_sdk/sdk_hooks/hooks.rb +103 -0
- data/lib/plex_ruby_sdk/sdk_hooks/registration.rb +35 -0
- data/lib/plex_ruby_sdk/sdk_hooks/types.rb +152 -0
- data/lib/plex_ruby_sdk/sdkconfiguration.rb +26 -7
- data/lib/plex_ruby_sdk/search.rb +174 -21
- data/lib/plex_ruby_sdk/server.rb +505 -53
- data/lib/plex_ruby_sdk/sessions.rb +228 -25
- data/lib/plex_ruby_sdk/statistics.rb +174 -21
- data/lib/plex_ruby_sdk/updater.rb +173 -20
- data/lib/plex_ruby_sdk/users.rb +56 -4
- data/lib/plex_ruby_sdk/utils/retries.rb +95 -0
- data/lib/plex_ruby_sdk/utils/utils.rb +10 -0
- data/lib/plex_ruby_sdk/video.rb +117 -14
- data/lib/plex_ruby_sdk/watchlist.rb +60 -7
- metadata +40 -23
- data/lib/plex_ruby_sdk/models/operations/get_library_items_enablecreditsmarkergeneration.rb +0 -18
- data/lib/plex_ruby_sdk/models/operations/get_library_items_episodesort.rb +0 -19
- data/lib/plex_ruby_sdk/models/operations/get_library_items_flattenseasons.rb +0 -19
- data/lib/plex_ruby_sdk/models/operations/get_library_items_mediaguid.rb +0 -26
- data/lib/plex_ruby_sdk/models/operations/get_library_items_optimizedforstreaming.rb +0 -18
- data/lib/plex_ruby_sdk/models/operations/get_library_items_showordering.rb +0 -27
- data/lib/plex_ruby_sdk/models/operations/getondeck_badrequest.rb +0 -24
- data/lib/plex_ruby_sdk/models/operations/getondeck_errors.rb +0 -30
- data/lib/plex_ruby_sdk/models/operations/getondeck_library_errors.rb +0 -30
- data/lib/plex_ruby_sdk/models/operations/getondeck_media.rb +0 -66
- data/lib/plex_ruby_sdk/models/operations/getondeck_mediacontainer.rb +0 -42
- data/lib/plex_ruby_sdk/models/operations/getondeck_metadata.rb +0 -129
- data/lib/plex_ruby_sdk/models/operations/getondeck_part.rb +0 -48
- data/lib/plex_ruby_sdk/models/operations/getondeck_response.rb +0 -39
- data/lib/plex_ruby_sdk/models/operations/getondeck_responsebody.rb +0 -24
- data/lib/plex_ruby_sdk/models/operations/getondeck_stream.rb +0 -90
- data/lib/plex_ruby_sdk/models/operations/getondeck_unauthorized.rb +0 -24
@@ -5,7 +5,10 @@
|
|
5
5
|
|
6
6
|
require 'faraday'
|
7
7
|
require 'faraday/multipart'
|
8
|
+
require 'faraday/retry'
|
8
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
11
|
+
require_relative 'utils/retries'
|
9
12
|
|
10
13
|
module PlexRubySDK
|
11
14
|
extend T::Sig
|
@@ -20,8 +23,8 @@ module PlexRubySDK
|
|
20
23
|
end
|
21
24
|
|
22
25
|
|
23
|
-
sig { params(url: ::String, type: T.nilable(::Float)).returns(::PlexRubySDK::Operations::GetFileHashResponse) }
|
24
|
-
def get_file_hash(url, type = nil)
|
26
|
+
sig { params(url: ::String, type: T.nilable(::Float), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetFileHashResponse) }
|
27
|
+
def get_file_hash(url, type = nil, timeout_ms = nil)
|
25
28
|
# get_file_hash - Get Hash Value
|
26
29
|
# This resource returns hash values for local files
|
27
30
|
request = ::PlexRubySDK::Operations::GetFileHashRequest.new(
|
@@ -37,11 +40,61 @@ module PlexRubySDK
|
|
37
40
|
headers['Accept'] = 'application/json'
|
38
41
|
headers['user-agent'] = @sdk_configuration.user_agent
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
44
|
+
|
45
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
46
|
+
timeout ||= @sdk_configuration.timeout
|
47
|
+
|
48
|
+
connection = @sdk_configuration.client
|
49
|
+
|
50
|
+
hook_ctx = SDKHooks::HookContext.new(
|
51
|
+
base_url: base_url,
|
52
|
+
oauth2_scopes: nil,
|
53
|
+
operation_id: 'getFileHash',
|
54
|
+
security_source: @sdk_configuration.security_source
|
55
|
+
)
|
56
|
+
|
57
|
+
error = T.let(nil, T.nilable(StandardError))
|
58
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
59
|
+
|
60
|
+
begin
|
61
|
+
r = connection.get(url) do |req|
|
62
|
+
req.headers.merge!(headers)
|
63
|
+
req.options.timeout = timeout unless timeout.nil?
|
64
|
+
req.params = query_params
|
65
|
+
Utils.configure_request_security(req, security)
|
66
|
+
|
67
|
+
@sdk_configuration.hooks.before_request(
|
68
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
69
|
+
hook_ctx: hook_ctx
|
70
|
+
),
|
71
|
+
request: req
|
72
|
+
)
|
73
|
+
end
|
74
|
+
rescue StandardError => e
|
75
|
+
error = e
|
76
|
+
ensure
|
77
|
+
if r.nil? || Utils.error_status?(r.status)
|
78
|
+
r = @sdk_configuration.hooks.after_error(
|
79
|
+
error: error,
|
80
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
81
|
+
hook_ctx: hook_ctx
|
82
|
+
),
|
83
|
+
response: r
|
84
|
+
)
|
85
|
+
else
|
86
|
+
r = @sdk_configuration.hooks.after_success(
|
87
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
88
|
+
hook_ctx: hook_ctx
|
89
|
+
),
|
90
|
+
response: r
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
if r.nil?
|
95
|
+
raise error if !error.nil?
|
96
|
+
raise 'no response'
|
97
|
+
end
|
45
98
|
end
|
46
99
|
|
47
100
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -66,8 +119,8 @@ module PlexRubySDK
|
|
66
119
|
end
|
67
120
|
|
68
121
|
|
69
|
-
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetRecentlyAddedLibraryRequest)).returns(::PlexRubySDK::Operations::GetRecentlyAddedLibraryResponse) }
|
70
|
-
def get_recently_added_library(request)
|
122
|
+
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetRecentlyAddedLibraryRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetRecentlyAddedLibraryResponse) }
|
123
|
+
def get_recently_added_library(request, timeout_ms = nil)
|
71
124
|
# get_recently_added_library - Get Recently Added
|
72
125
|
# This endpoint will return the recently added content.
|
73
126
|
#
|
@@ -79,11 +132,61 @@ module PlexRubySDK
|
|
79
132
|
headers['Accept'] = 'application/json'
|
80
133
|
headers['user-agent'] = @sdk_configuration.user_agent
|
81
134
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
135
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
136
|
+
|
137
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
138
|
+
timeout ||= @sdk_configuration.timeout
|
139
|
+
|
140
|
+
connection = @sdk_configuration.client
|
141
|
+
|
142
|
+
hook_ctx = SDKHooks::HookContext.new(
|
143
|
+
base_url: base_url,
|
144
|
+
oauth2_scopes: nil,
|
145
|
+
operation_id: 'get-recently-added-library',
|
146
|
+
security_source: @sdk_configuration.security_source
|
147
|
+
)
|
148
|
+
|
149
|
+
error = T.let(nil, T.nilable(StandardError))
|
150
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
151
|
+
|
152
|
+
begin
|
153
|
+
r = connection.get(url) do |req|
|
154
|
+
req.headers.merge!(headers)
|
155
|
+
req.options.timeout = timeout unless timeout.nil?
|
156
|
+
req.params = query_params
|
157
|
+
Utils.configure_request_security(req, security)
|
158
|
+
|
159
|
+
@sdk_configuration.hooks.before_request(
|
160
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
161
|
+
hook_ctx: hook_ctx
|
162
|
+
),
|
163
|
+
request: req
|
164
|
+
)
|
165
|
+
end
|
166
|
+
rescue StandardError => e
|
167
|
+
error = e
|
168
|
+
ensure
|
169
|
+
if r.nil? || Utils.error_status?(r.status)
|
170
|
+
r = @sdk_configuration.hooks.after_error(
|
171
|
+
error: error,
|
172
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
173
|
+
hook_ctx: hook_ctx
|
174
|
+
),
|
175
|
+
response: r
|
176
|
+
)
|
177
|
+
else
|
178
|
+
r = @sdk_configuration.hooks.after_success(
|
179
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
180
|
+
hook_ctx: hook_ctx
|
181
|
+
),
|
182
|
+
response: r
|
183
|
+
)
|
184
|
+
end
|
185
|
+
|
186
|
+
if r.nil?
|
187
|
+
raise error if !error.nil?
|
188
|
+
raise 'no response'
|
189
|
+
end
|
87
190
|
end
|
88
191
|
|
89
192
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -112,8 +215,8 @@ module PlexRubySDK
|
|
112
215
|
end
|
113
216
|
|
114
217
|
|
115
|
-
sig { returns(::PlexRubySDK::Operations::GetAllLibrariesResponse) }
|
116
|
-
def get_all_libraries
|
218
|
+
sig { params(timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetAllLibrariesResponse) }
|
219
|
+
def get_all_libraries(timeout_ms = nil)
|
117
220
|
# get_all_libraries - Get All Libraries
|
118
221
|
# A library section (commonly referred to as just a library) is a collection of media.
|
119
222
|
# Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media.
|
@@ -129,10 +232,60 @@ module PlexRubySDK
|
|
129
232
|
headers['Accept'] = 'application/json'
|
130
233
|
headers['user-agent'] = @sdk_configuration.user_agent
|
131
234
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
235
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
236
|
+
|
237
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
238
|
+
timeout ||= @sdk_configuration.timeout
|
239
|
+
|
240
|
+
connection = @sdk_configuration.client
|
241
|
+
|
242
|
+
hook_ctx = SDKHooks::HookContext.new(
|
243
|
+
base_url: base_url,
|
244
|
+
oauth2_scopes: nil,
|
245
|
+
operation_id: 'get-all-libraries',
|
246
|
+
security_source: @sdk_configuration.security_source
|
247
|
+
)
|
248
|
+
|
249
|
+
error = T.let(nil, T.nilable(StandardError))
|
250
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
251
|
+
|
252
|
+
begin
|
253
|
+
r = connection.get(url) do |req|
|
254
|
+
req.headers.merge!(headers)
|
255
|
+
req.options.timeout = timeout unless timeout.nil?
|
256
|
+
Utils.configure_request_security(req, security)
|
257
|
+
|
258
|
+
@sdk_configuration.hooks.before_request(
|
259
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
260
|
+
hook_ctx: hook_ctx
|
261
|
+
),
|
262
|
+
request: req
|
263
|
+
)
|
264
|
+
end
|
265
|
+
rescue StandardError => e
|
266
|
+
error = e
|
267
|
+
ensure
|
268
|
+
if r.nil? || Utils.error_status?(r.status)
|
269
|
+
r = @sdk_configuration.hooks.after_error(
|
270
|
+
error: error,
|
271
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
272
|
+
hook_ctx: hook_ctx
|
273
|
+
),
|
274
|
+
response: r
|
275
|
+
)
|
276
|
+
else
|
277
|
+
r = @sdk_configuration.hooks.after_success(
|
278
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
279
|
+
hook_ctx: hook_ctx
|
280
|
+
),
|
281
|
+
response: r
|
282
|
+
)
|
283
|
+
end
|
284
|
+
|
285
|
+
if r.nil?
|
286
|
+
raise error if !error.nil?
|
287
|
+
raise 'no response'
|
288
|
+
end
|
136
289
|
end
|
137
290
|
|
138
291
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -161,8 +314,8 @@ module PlexRubySDK
|
|
161
314
|
end
|
162
315
|
|
163
316
|
|
164
|
-
sig { params(section_key: ::Integer, include_details: T.nilable(::PlexRubySDK::Operations::IncludeDetails)).returns(::PlexRubySDK::Operations::GetLibraryDetailsResponse) }
|
165
|
-
def get_library_details(section_key, include_details = nil)
|
317
|
+
sig { params(section_key: ::Integer, include_details: T.nilable(::PlexRubySDK::Operations::IncludeDetails), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetLibraryDetailsResponse) }
|
318
|
+
def get_library_details(section_key, include_details = nil, timeout_ms = nil)
|
166
319
|
# get_library_details - Get Library Details
|
167
320
|
# ## Library Details Endpoint
|
168
321
|
#
|
@@ -222,11 +375,61 @@ module PlexRubySDK
|
|
222
375
|
headers['Accept'] = 'application/json'
|
223
376
|
headers['user-agent'] = @sdk_configuration.user_agent
|
224
377
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
378
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
379
|
+
|
380
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
381
|
+
timeout ||= @sdk_configuration.timeout
|
382
|
+
|
383
|
+
connection = @sdk_configuration.client
|
384
|
+
|
385
|
+
hook_ctx = SDKHooks::HookContext.new(
|
386
|
+
base_url: base_url,
|
387
|
+
oauth2_scopes: nil,
|
388
|
+
operation_id: 'get-library-details',
|
389
|
+
security_source: @sdk_configuration.security_source
|
390
|
+
)
|
391
|
+
|
392
|
+
error = T.let(nil, T.nilable(StandardError))
|
393
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
394
|
+
|
395
|
+
begin
|
396
|
+
r = connection.get(url) do |req|
|
397
|
+
req.headers.merge!(headers)
|
398
|
+
req.options.timeout = timeout unless timeout.nil?
|
399
|
+
req.params = query_params
|
400
|
+
Utils.configure_request_security(req, security)
|
401
|
+
|
402
|
+
@sdk_configuration.hooks.before_request(
|
403
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
404
|
+
hook_ctx: hook_ctx
|
405
|
+
),
|
406
|
+
request: req
|
407
|
+
)
|
408
|
+
end
|
409
|
+
rescue StandardError => e
|
410
|
+
error = e
|
411
|
+
ensure
|
412
|
+
if r.nil? || Utils.error_status?(r.status)
|
413
|
+
r = @sdk_configuration.hooks.after_error(
|
414
|
+
error: error,
|
415
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
416
|
+
hook_ctx: hook_ctx
|
417
|
+
),
|
418
|
+
response: r
|
419
|
+
)
|
420
|
+
else
|
421
|
+
r = @sdk_configuration.hooks.after_success(
|
422
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
423
|
+
hook_ctx: hook_ctx
|
424
|
+
),
|
425
|
+
response: r
|
426
|
+
)
|
427
|
+
end
|
428
|
+
|
429
|
+
if r.nil?
|
430
|
+
raise error if !error.nil?
|
431
|
+
raise 'no response'
|
432
|
+
end
|
230
433
|
end
|
231
434
|
|
232
435
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -255,8 +458,8 @@ module PlexRubySDK
|
|
255
458
|
end
|
256
459
|
|
257
460
|
|
258
|
-
sig { params(section_key: ::Integer).returns(::PlexRubySDK::Operations::DeleteLibraryResponse) }
|
259
|
-
def delete_library(section_key)
|
461
|
+
sig { params(section_key: ::Integer, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::DeleteLibraryResponse) }
|
462
|
+
def delete_library(section_key, timeout_ms = nil)
|
260
463
|
# delete_library - Delete Library Section
|
261
464
|
# Delete a library using a specific section id
|
262
465
|
request = ::PlexRubySDK::Operations::DeleteLibraryRequest.new(
|
@@ -275,10 +478,60 @@ module PlexRubySDK
|
|
275
478
|
headers['Accept'] = 'application/json'
|
276
479
|
headers['user-agent'] = @sdk_configuration.user_agent
|
277
480
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
481
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
482
|
+
|
483
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
484
|
+
timeout ||= @sdk_configuration.timeout
|
485
|
+
|
486
|
+
connection = @sdk_configuration.client
|
487
|
+
|
488
|
+
hook_ctx = SDKHooks::HookContext.new(
|
489
|
+
base_url: base_url,
|
490
|
+
oauth2_scopes: nil,
|
491
|
+
operation_id: 'deleteLibrary',
|
492
|
+
security_source: @sdk_configuration.security_source
|
493
|
+
)
|
494
|
+
|
495
|
+
error = T.let(nil, T.nilable(StandardError))
|
496
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
497
|
+
|
498
|
+
begin
|
499
|
+
r = connection.delete(url) do |req|
|
500
|
+
req.headers.merge!(headers)
|
501
|
+
req.options.timeout = timeout unless timeout.nil?
|
502
|
+
Utils.configure_request_security(req, security)
|
503
|
+
|
504
|
+
@sdk_configuration.hooks.before_request(
|
505
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
506
|
+
hook_ctx: hook_ctx
|
507
|
+
),
|
508
|
+
request: req
|
509
|
+
)
|
510
|
+
end
|
511
|
+
rescue StandardError => e
|
512
|
+
error = e
|
513
|
+
ensure
|
514
|
+
if r.nil? || Utils.error_status?(r.status)
|
515
|
+
r = @sdk_configuration.hooks.after_error(
|
516
|
+
error: error,
|
517
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
518
|
+
hook_ctx: hook_ctx
|
519
|
+
),
|
520
|
+
response: r
|
521
|
+
)
|
522
|
+
else
|
523
|
+
r = @sdk_configuration.hooks.after_success(
|
524
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
525
|
+
hook_ctx: hook_ctx
|
526
|
+
),
|
527
|
+
response: r
|
528
|
+
)
|
529
|
+
end
|
530
|
+
|
531
|
+
if r.nil?
|
532
|
+
raise error if !error.nil?
|
533
|
+
raise 'no response'
|
534
|
+
end
|
282
535
|
end
|
283
536
|
|
284
537
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -303,8 +556,8 @@ module PlexRubySDK
|
|
303
556
|
end
|
304
557
|
|
305
558
|
|
306
|
-
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetLibraryItemsRequest)).returns(::PlexRubySDK::Operations::GetLibraryItemsResponse) }
|
307
|
-
def get_library_items(request)
|
559
|
+
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetLibraryItemsRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetLibraryItemsResponse) }
|
560
|
+
def get_library_items(request, timeout_ms = nil)
|
308
561
|
# get_library_items - Get Library Items
|
309
562
|
# Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
|
310
563
|
# - `all`: All items in the section.
|
@@ -341,11 +594,61 @@ module PlexRubySDK
|
|
341
594
|
headers['Accept'] = 'application/json'
|
342
595
|
headers['user-agent'] = @sdk_configuration.user_agent
|
343
596
|
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
597
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
598
|
+
|
599
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
600
|
+
timeout ||= @sdk_configuration.timeout
|
601
|
+
|
602
|
+
connection = @sdk_configuration.client
|
603
|
+
|
604
|
+
hook_ctx = SDKHooks::HookContext.new(
|
605
|
+
base_url: base_url,
|
606
|
+
oauth2_scopes: nil,
|
607
|
+
operation_id: 'get-library-items',
|
608
|
+
security_source: @sdk_configuration.security_source
|
609
|
+
)
|
610
|
+
|
611
|
+
error = T.let(nil, T.nilable(StandardError))
|
612
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
613
|
+
|
614
|
+
begin
|
615
|
+
r = connection.get(url) do |req|
|
616
|
+
req.headers.merge!(headers)
|
617
|
+
req.options.timeout = timeout unless timeout.nil?
|
618
|
+
req.params = query_params
|
619
|
+
Utils.configure_request_security(req, security)
|
620
|
+
|
621
|
+
@sdk_configuration.hooks.before_request(
|
622
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
623
|
+
hook_ctx: hook_ctx
|
624
|
+
),
|
625
|
+
request: req
|
626
|
+
)
|
627
|
+
end
|
628
|
+
rescue StandardError => e
|
629
|
+
error = e
|
630
|
+
ensure
|
631
|
+
if r.nil? || Utils.error_status?(r.status)
|
632
|
+
r = @sdk_configuration.hooks.after_error(
|
633
|
+
error: error,
|
634
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
635
|
+
hook_ctx: hook_ctx
|
636
|
+
),
|
637
|
+
response: r
|
638
|
+
)
|
639
|
+
else
|
640
|
+
r = @sdk_configuration.hooks.after_success(
|
641
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
642
|
+
hook_ctx: hook_ctx
|
643
|
+
),
|
644
|
+
response: r
|
645
|
+
)
|
646
|
+
end
|
647
|
+
|
648
|
+
if r.nil?
|
649
|
+
raise error if !error.nil?
|
650
|
+
raise 'no response'
|
651
|
+
end
|
349
652
|
end
|
350
653
|
|
351
654
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -374,8 +677,8 @@ module PlexRubySDK
|
|
374
677
|
end
|
375
678
|
|
376
679
|
|
377
|
-
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetAllMediaLibraryRequest)).returns(::PlexRubySDK::Operations::GetAllMediaLibraryResponse) }
|
378
|
-
def get_all_media_library(request)
|
680
|
+
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetAllMediaLibraryRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetAllMediaLibraryResponse) }
|
681
|
+
def get_all_media_library(request, timeout_ms = nil)
|
379
682
|
# get_all_media_library - Get all media of library
|
380
683
|
# Retrieves a list of all general media data for this library.
|
381
684
|
#
|
@@ -392,11 +695,61 @@ module PlexRubySDK
|
|
392
695
|
headers['Accept'] = 'application/json'
|
393
696
|
headers['user-agent'] = @sdk_configuration.user_agent
|
394
697
|
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
698
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
699
|
+
|
700
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
701
|
+
timeout ||= @sdk_configuration.timeout
|
702
|
+
|
703
|
+
connection = @sdk_configuration.client
|
704
|
+
|
705
|
+
hook_ctx = SDKHooks::HookContext.new(
|
706
|
+
base_url: base_url,
|
707
|
+
oauth2_scopes: nil,
|
708
|
+
operation_id: 'get-all-media-library',
|
709
|
+
security_source: @sdk_configuration.security_source
|
710
|
+
)
|
711
|
+
|
712
|
+
error = T.let(nil, T.nilable(StandardError))
|
713
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
714
|
+
|
715
|
+
begin
|
716
|
+
r = connection.get(url) do |req|
|
717
|
+
req.headers.merge!(headers)
|
718
|
+
req.options.timeout = timeout unless timeout.nil?
|
719
|
+
req.params = query_params
|
720
|
+
Utils.configure_request_security(req, security)
|
721
|
+
|
722
|
+
@sdk_configuration.hooks.before_request(
|
723
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
724
|
+
hook_ctx: hook_ctx
|
725
|
+
),
|
726
|
+
request: req
|
727
|
+
)
|
728
|
+
end
|
729
|
+
rescue StandardError => e
|
730
|
+
error = e
|
731
|
+
ensure
|
732
|
+
if r.nil? || Utils.error_status?(r.status)
|
733
|
+
r = @sdk_configuration.hooks.after_error(
|
734
|
+
error: error,
|
735
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
736
|
+
hook_ctx: hook_ctx
|
737
|
+
),
|
738
|
+
response: r
|
739
|
+
)
|
740
|
+
else
|
741
|
+
r = @sdk_configuration.hooks.after_success(
|
742
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
743
|
+
hook_ctx: hook_ctx
|
744
|
+
),
|
745
|
+
response: r
|
746
|
+
)
|
747
|
+
end
|
748
|
+
|
749
|
+
if r.nil?
|
750
|
+
raise error if !error.nil?
|
751
|
+
raise 'no response'
|
752
|
+
end
|
400
753
|
end
|
401
754
|
|
402
755
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -426,8 +779,8 @@ module PlexRubySDK
|
|
426
779
|
end
|
427
780
|
|
428
781
|
|
429
|
-
sig { params(section_key: ::Integer, force: T.nilable(::PlexRubySDK::Operations::Force)).returns(::PlexRubySDK::Operations::GetRefreshLibraryMetadataResponse) }
|
430
|
-
def get_refresh_library_metadata(section_key, force = nil)
|
782
|
+
sig { params(section_key: ::Integer, force: T.nilable(::PlexRubySDK::Operations::Force), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetRefreshLibraryMetadataResponse) }
|
783
|
+
def get_refresh_library_metadata(section_key, force = nil, timeout_ms = nil)
|
431
784
|
# get_refresh_library_metadata - Refresh Metadata Of The Library
|
432
785
|
# This endpoint Refreshes all the Metadata of the library.
|
433
786
|
#
|
@@ -449,11 +802,61 @@ module PlexRubySDK
|
|
449
802
|
headers['Accept'] = 'application/json'
|
450
803
|
headers['user-agent'] = @sdk_configuration.user_agent
|
451
804
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
805
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
806
|
+
|
807
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
808
|
+
timeout ||= @sdk_configuration.timeout
|
809
|
+
|
810
|
+
connection = @sdk_configuration.client
|
811
|
+
|
812
|
+
hook_ctx = SDKHooks::HookContext.new(
|
813
|
+
base_url: base_url,
|
814
|
+
oauth2_scopes: nil,
|
815
|
+
operation_id: 'get-refresh-library-metadata',
|
816
|
+
security_source: @sdk_configuration.security_source
|
817
|
+
)
|
818
|
+
|
819
|
+
error = T.let(nil, T.nilable(StandardError))
|
820
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
821
|
+
|
822
|
+
begin
|
823
|
+
r = connection.get(url) do |req|
|
824
|
+
req.headers.merge!(headers)
|
825
|
+
req.options.timeout = timeout unless timeout.nil?
|
826
|
+
req.params = query_params
|
827
|
+
Utils.configure_request_security(req, security)
|
828
|
+
|
829
|
+
@sdk_configuration.hooks.before_request(
|
830
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
831
|
+
hook_ctx: hook_ctx
|
832
|
+
),
|
833
|
+
request: req
|
834
|
+
)
|
835
|
+
end
|
836
|
+
rescue StandardError => e
|
837
|
+
error = e
|
838
|
+
ensure
|
839
|
+
if r.nil? || Utils.error_status?(r.status)
|
840
|
+
r = @sdk_configuration.hooks.after_error(
|
841
|
+
error: error,
|
842
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
843
|
+
hook_ctx: hook_ctx
|
844
|
+
),
|
845
|
+
response: r
|
846
|
+
)
|
847
|
+
else
|
848
|
+
r = @sdk_configuration.hooks.after_success(
|
849
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
850
|
+
hook_ctx: hook_ctx
|
851
|
+
),
|
852
|
+
response: r
|
853
|
+
)
|
854
|
+
end
|
855
|
+
|
856
|
+
if r.nil?
|
857
|
+
raise error if !error.nil?
|
858
|
+
raise 'no response'
|
859
|
+
end
|
457
860
|
end
|
458
861
|
|
459
862
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -478,8 +881,8 @@ module PlexRubySDK
|
|
478
881
|
end
|
479
882
|
|
480
883
|
|
481
|
-
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetSearchLibraryQueryParamType).returns(::PlexRubySDK::Operations::GetSearchLibraryResponse) }
|
482
|
-
def get_search_library(section_key, type)
|
884
|
+
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetSearchLibraryQueryParamType, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetSearchLibraryResponse) }
|
885
|
+
def get_search_library(section_key, type, timeout_ms = nil)
|
483
886
|
# get_search_library - Search Library
|
484
887
|
# Search for content within a specific section of the library.
|
485
888
|
#
|
@@ -518,11 +921,61 @@ module PlexRubySDK
|
|
518
921
|
headers['Accept'] = 'application/json'
|
519
922
|
headers['user-agent'] = @sdk_configuration.user_agent
|
520
923
|
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
924
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
925
|
+
|
926
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
927
|
+
timeout ||= @sdk_configuration.timeout
|
928
|
+
|
929
|
+
connection = @sdk_configuration.client
|
930
|
+
|
931
|
+
hook_ctx = SDKHooks::HookContext.new(
|
932
|
+
base_url: base_url,
|
933
|
+
oauth2_scopes: nil,
|
934
|
+
operation_id: 'get-search-library',
|
935
|
+
security_source: @sdk_configuration.security_source
|
936
|
+
)
|
937
|
+
|
938
|
+
error = T.let(nil, T.nilable(StandardError))
|
939
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
940
|
+
|
941
|
+
begin
|
942
|
+
r = connection.get(url) do |req|
|
943
|
+
req.headers.merge!(headers)
|
944
|
+
req.options.timeout = timeout unless timeout.nil?
|
945
|
+
req.params = query_params
|
946
|
+
Utils.configure_request_security(req, security)
|
947
|
+
|
948
|
+
@sdk_configuration.hooks.before_request(
|
949
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
950
|
+
hook_ctx: hook_ctx
|
951
|
+
),
|
952
|
+
request: req
|
953
|
+
)
|
954
|
+
end
|
955
|
+
rescue StandardError => e
|
956
|
+
error = e
|
957
|
+
ensure
|
958
|
+
if r.nil? || Utils.error_status?(r.status)
|
959
|
+
r = @sdk_configuration.hooks.after_error(
|
960
|
+
error: error,
|
961
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
962
|
+
hook_ctx: hook_ctx
|
963
|
+
),
|
964
|
+
response: r
|
965
|
+
)
|
966
|
+
else
|
967
|
+
r = @sdk_configuration.hooks.after_success(
|
968
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
969
|
+
hook_ctx: hook_ctx
|
970
|
+
),
|
971
|
+
response: r
|
972
|
+
)
|
973
|
+
end
|
974
|
+
|
975
|
+
if r.nil?
|
976
|
+
raise error if !error.nil?
|
977
|
+
raise 'no response'
|
978
|
+
end
|
526
979
|
end
|
527
980
|
|
528
981
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -551,8 +1004,8 @@ module PlexRubySDK
|
|
551
1004
|
end
|
552
1005
|
|
553
1006
|
|
554
|
-
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetGenresLibraryQueryParamType).returns(::PlexRubySDK::Operations::GetGenresLibraryResponse) }
|
555
|
-
def get_genres_library(section_key, type)
|
1007
|
+
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetGenresLibraryQueryParamType, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetGenresLibraryResponse) }
|
1008
|
+
def get_genres_library(section_key, type, timeout_ms = nil)
|
556
1009
|
# get_genres_library - Get Genres of library media
|
557
1010
|
# Retrieves a list of all the genres that are found for the media in this library.
|
558
1011
|
#
|
@@ -574,11 +1027,61 @@ module PlexRubySDK
|
|
574
1027
|
headers['Accept'] = 'application/json'
|
575
1028
|
headers['user-agent'] = @sdk_configuration.user_agent
|
576
1029
|
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
1030
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1031
|
+
|
1032
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1033
|
+
timeout ||= @sdk_configuration.timeout
|
1034
|
+
|
1035
|
+
connection = @sdk_configuration.client
|
1036
|
+
|
1037
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1038
|
+
base_url: base_url,
|
1039
|
+
oauth2_scopes: nil,
|
1040
|
+
operation_id: 'get-genres-library',
|
1041
|
+
security_source: @sdk_configuration.security_source
|
1042
|
+
)
|
1043
|
+
|
1044
|
+
error = T.let(nil, T.nilable(StandardError))
|
1045
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1046
|
+
|
1047
|
+
begin
|
1048
|
+
r = connection.get(url) do |req|
|
1049
|
+
req.headers.merge!(headers)
|
1050
|
+
req.options.timeout = timeout unless timeout.nil?
|
1051
|
+
req.params = query_params
|
1052
|
+
Utils.configure_request_security(req, security)
|
1053
|
+
|
1054
|
+
@sdk_configuration.hooks.before_request(
|
1055
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1056
|
+
hook_ctx: hook_ctx
|
1057
|
+
),
|
1058
|
+
request: req
|
1059
|
+
)
|
1060
|
+
end
|
1061
|
+
rescue StandardError => e
|
1062
|
+
error = e
|
1063
|
+
ensure
|
1064
|
+
if r.nil? || Utils.error_status?(r.status)
|
1065
|
+
r = @sdk_configuration.hooks.after_error(
|
1066
|
+
error: error,
|
1067
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1068
|
+
hook_ctx: hook_ctx
|
1069
|
+
),
|
1070
|
+
response: r
|
1071
|
+
)
|
1072
|
+
else
|
1073
|
+
r = @sdk_configuration.hooks.after_success(
|
1074
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1075
|
+
hook_ctx: hook_ctx
|
1076
|
+
),
|
1077
|
+
response: r
|
1078
|
+
)
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
if r.nil?
|
1082
|
+
raise error if !error.nil?
|
1083
|
+
raise 'no response'
|
1084
|
+
end
|
582
1085
|
end
|
583
1086
|
|
584
1087
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -608,8 +1111,8 @@ module PlexRubySDK
|
|
608
1111
|
end
|
609
1112
|
|
610
1113
|
|
611
|
-
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetCountriesLibraryQueryParamType).returns(::PlexRubySDK::Operations::GetCountriesLibraryResponse) }
|
612
|
-
def get_countries_library(section_key, type)
|
1114
|
+
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetCountriesLibraryQueryParamType, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetCountriesLibraryResponse) }
|
1115
|
+
def get_countries_library(section_key, type, timeout_ms = nil)
|
613
1116
|
# get_countries_library - Get Countries of library media
|
614
1117
|
# Retrieves a list of all the countries that are found for the media in this library.
|
615
1118
|
#
|
@@ -631,11 +1134,61 @@ module PlexRubySDK
|
|
631
1134
|
headers['Accept'] = 'application/json'
|
632
1135
|
headers['user-agent'] = @sdk_configuration.user_agent
|
633
1136
|
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
1137
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1138
|
+
|
1139
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1140
|
+
timeout ||= @sdk_configuration.timeout
|
1141
|
+
|
1142
|
+
connection = @sdk_configuration.client
|
1143
|
+
|
1144
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1145
|
+
base_url: base_url,
|
1146
|
+
oauth2_scopes: nil,
|
1147
|
+
operation_id: 'get-countries-library',
|
1148
|
+
security_source: @sdk_configuration.security_source
|
1149
|
+
)
|
1150
|
+
|
1151
|
+
error = T.let(nil, T.nilable(StandardError))
|
1152
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1153
|
+
|
1154
|
+
begin
|
1155
|
+
r = connection.get(url) do |req|
|
1156
|
+
req.headers.merge!(headers)
|
1157
|
+
req.options.timeout = timeout unless timeout.nil?
|
1158
|
+
req.params = query_params
|
1159
|
+
Utils.configure_request_security(req, security)
|
1160
|
+
|
1161
|
+
@sdk_configuration.hooks.before_request(
|
1162
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1163
|
+
hook_ctx: hook_ctx
|
1164
|
+
),
|
1165
|
+
request: req
|
1166
|
+
)
|
1167
|
+
end
|
1168
|
+
rescue StandardError => e
|
1169
|
+
error = e
|
1170
|
+
ensure
|
1171
|
+
if r.nil? || Utils.error_status?(r.status)
|
1172
|
+
r = @sdk_configuration.hooks.after_error(
|
1173
|
+
error: error,
|
1174
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1175
|
+
hook_ctx: hook_ctx
|
1176
|
+
),
|
1177
|
+
response: r
|
1178
|
+
)
|
1179
|
+
else
|
1180
|
+
r = @sdk_configuration.hooks.after_success(
|
1181
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1182
|
+
hook_ctx: hook_ctx
|
1183
|
+
),
|
1184
|
+
response: r
|
1185
|
+
)
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
if r.nil?
|
1189
|
+
raise error if !error.nil?
|
1190
|
+
raise 'no response'
|
1191
|
+
end
|
639
1192
|
end
|
640
1193
|
|
641
1194
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -665,8 +1218,8 @@ module PlexRubySDK
|
|
665
1218
|
end
|
666
1219
|
|
667
1220
|
|
668
|
-
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetActorsLibraryQueryParamType).returns(::PlexRubySDK::Operations::GetActorsLibraryResponse) }
|
669
|
-
def get_actors_library(section_key, type)
|
1221
|
+
sig { params(section_key: ::Integer, type: ::PlexRubySDK::Operations::GetActorsLibraryQueryParamType, timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetActorsLibraryResponse) }
|
1222
|
+
def get_actors_library(section_key, type, timeout_ms = nil)
|
670
1223
|
# get_actors_library - Get Actors of library media
|
671
1224
|
# Retrieves a list of all the actors that are found for the media in this library.
|
672
1225
|
#
|
@@ -688,11 +1241,61 @@ module PlexRubySDK
|
|
688
1241
|
headers['Accept'] = 'application/json'
|
689
1242
|
headers['user-agent'] = @sdk_configuration.user_agent
|
690
1243
|
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
1244
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1245
|
+
|
1246
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1247
|
+
timeout ||= @sdk_configuration.timeout
|
1248
|
+
|
1249
|
+
connection = @sdk_configuration.client
|
1250
|
+
|
1251
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1252
|
+
base_url: base_url,
|
1253
|
+
oauth2_scopes: nil,
|
1254
|
+
operation_id: 'get-actors-library',
|
1255
|
+
security_source: @sdk_configuration.security_source
|
1256
|
+
)
|
1257
|
+
|
1258
|
+
error = T.let(nil, T.nilable(StandardError))
|
1259
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1260
|
+
|
1261
|
+
begin
|
1262
|
+
r = connection.get(url) do |req|
|
1263
|
+
req.headers.merge!(headers)
|
1264
|
+
req.options.timeout = timeout unless timeout.nil?
|
1265
|
+
req.params = query_params
|
1266
|
+
Utils.configure_request_security(req, security)
|
1267
|
+
|
1268
|
+
@sdk_configuration.hooks.before_request(
|
1269
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1270
|
+
hook_ctx: hook_ctx
|
1271
|
+
),
|
1272
|
+
request: req
|
1273
|
+
)
|
1274
|
+
end
|
1275
|
+
rescue StandardError => e
|
1276
|
+
error = e
|
1277
|
+
ensure
|
1278
|
+
if r.nil? || Utils.error_status?(r.status)
|
1279
|
+
r = @sdk_configuration.hooks.after_error(
|
1280
|
+
error: error,
|
1281
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1282
|
+
hook_ctx: hook_ctx
|
1283
|
+
),
|
1284
|
+
response: r
|
1285
|
+
)
|
1286
|
+
else
|
1287
|
+
r = @sdk_configuration.hooks.after_success(
|
1288
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1289
|
+
hook_ctx: hook_ctx
|
1290
|
+
),
|
1291
|
+
response: r
|
1292
|
+
)
|
1293
|
+
end
|
1294
|
+
|
1295
|
+
if r.nil?
|
1296
|
+
raise error if !error.nil?
|
1297
|
+
raise 'no response'
|
1298
|
+
end
|
696
1299
|
end
|
697
1300
|
|
698
1301
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -722,8 +1325,8 @@ module PlexRubySDK
|
|
722
1325
|
end
|
723
1326
|
|
724
1327
|
|
725
|
-
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetSearchAllLibrariesRequest)).returns(::PlexRubySDK::Operations::GetSearchAllLibrariesResponse) }
|
726
|
-
def get_search_all_libraries(request)
|
1328
|
+
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetSearchAllLibrariesRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetSearchAllLibrariesResponse) }
|
1329
|
+
def get_search_all_libraries(request, timeout_ms = nil)
|
727
1330
|
# get_search_all_libraries - Search All Libraries
|
728
1331
|
# Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
|
729
1332
|
#
|
@@ -735,11 +1338,61 @@ module PlexRubySDK
|
|
735
1338
|
headers['Accept'] = 'application/json'
|
736
1339
|
headers['user-agent'] = @sdk_configuration.user_agent
|
737
1340
|
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
1341
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1342
|
+
|
1343
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1344
|
+
timeout ||= @sdk_configuration.timeout
|
1345
|
+
|
1346
|
+
connection = @sdk_configuration.client
|
1347
|
+
|
1348
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1349
|
+
base_url: base_url,
|
1350
|
+
oauth2_scopes: nil,
|
1351
|
+
operation_id: 'get-search-all-libraries',
|
1352
|
+
security_source: @sdk_configuration.security_source
|
1353
|
+
)
|
1354
|
+
|
1355
|
+
error = T.let(nil, T.nilable(StandardError))
|
1356
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1357
|
+
|
1358
|
+
begin
|
1359
|
+
r = connection.get(url) do |req|
|
1360
|
+
req.headers.merge!(headers)
|
1361
|
+
req.options.timeout = timeout unless timeout.nil?
|
1362
|
+
req.params = query_params
|
1363
|
+
Utils.configure_request_security(req, security)
|
1364
|
+
|
1365
|
+
@sdk_configuration.hooks.before_request(
|
1366
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1367
|
+
hook_ctx: hook_ctx
|
1368
|
+
),
|
1369
|
+
request: req
|
1370
|
+
)
|
1371
|
+
end
|
1372
|
+
rescue StandardError => e
|
1373
|
+
error = e
|
1374
|
+
ensure
|
1375
|
+
if r.nil? || Utils.error_status?(r.status)
|
1376
|
+
r = @sdk_configuration.hooks.after_error(
|
1377
|
+
error: error,
|
1378
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1379
|
+
hook_ctx: hook_ctx
|
1380
|
+
),
|
1381
|
+
response: r
|
1382
|
+
)
|
1383
|
+
else
|
1384
|
+
r = @sdk_configuration.hooks.after_success(
|
1385
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1386
|
+
hook_ctx: hook_ctx
|
1387
|
+
),
|
1388
|
+
response: r
|
1389
|
+
)
|
1390
|
+
end
|
1391
|
+
|
1392
|
+
if r.nil?
|
1393
|
+
raise error if !error.nil?
|
1394
|
+
raise 'no response'
|
1395
|
+
end
|
743
1396
|
end
|
744
1397
|
|
745
1398
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -768,8 +1421,8 @@ module PlexRubySDK
|
|
768
1421
|
end
|
769
1422
|
|
770
1423
|
|
771
|
-
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetMediaMetaDataRequest)).returns(::PlexRubySDK::Operations::GetMediaMetaDataResponse) }
|
772
|
-
def get_media_meta_data(request)
|
1424
|
+
sig { params(request: T.nilable(::PlexRubySDK::Operations::GetMediaMetaDataRequest), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetMediaMetaDataResponse) }
|
1425
|
+
def get_media_meta_data(request, timeout_ms = nil)
|
773
1426
|
# get_media_meta_data - Get Media Metadata
|
774
1427
|
# This endpoint will return all the (meta)data of a library item specified with by the ratingKey.
|
775
1428
|
#
|
@@ -786,11 +1439,61 @@ module PlexRubySDK
|
|
786
1439
|
headers['Accept'] = 'application/json'
|
787
1440
|
headers['user-agent'] = @sdk_configuration.user_agent
|
788
1441
|
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
1442
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1443
|
+
|
1444
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1445
|
+
timeout ||= @sdk_configuration.timeout
|
1446
|
+
|
1447
|
+
connection = @sdk_configuration.client
|
1448
|
+
|
1449
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1450
|
+
base_url: base_url,
|
1451
|
+
oauth2_scopes: nil,
|
1452
|
+
operation_id: 'get-media-meta-data',
|
1453
|
+
security_source: @sdk_configuration.security_source
|
1454
|
+
)
|
1455
|
+
|
1456
|
+
error = T.let(nil, T.nilable(StandardError))
|
1457
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1458
|
+
|
1459
|
+
begin
|
1460
|
+
r = connection.get(url) do |req|
|
1461
|
+
req.headers.merge!(headers)
|
1462
|
+
req.options.timeout = timeout unless timeout.nil?
|
1463
|
+
req.params = query_params
|
1464
|
+
Utils.configure_request_security(req, security)
|
1465
|
+
|
1466
|
+
@sdk_configuration.hooks.before_request(
|
1467
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1468
|
+
hook_ctx: hook_ctx
|
1469
|
+
),
|
1470
|
+
request: req
|
1471
|
+
)
|
1472
|
+
end
|
1473
|
+
rescue StandardError => e
|
1474
|
+
error = e
|
1475
|
+
ensure
|
1476
|
+
if r.nil? || Utils.error_status?(r.status)
|
1477
|
+
r = @sdk_configuration.hooks.after_error(
|
1478
|
+
error: error,
|
1479
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1480
|
+
hook_ctx: hook_ctx
|
1481
|
+
),
|
1482
|
+
response: r
|
1483
|
+
)
|
1484
|
+
else
|
1485
|
+
r = @sdk_configuration.hooks.after_success(
|
1486
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1487
|
+
hook_ctx: hook_ctx
|
1488
|
+
),
|
1489
|
+
response: r
|
1490
|
+
)
|
1491
|
+
end
|
1492
|
+
|
1493
|
+
if r.nil?
|
1494
|
+
raise error if !error.nil?
|
1495
|
+
raise 'no response'
|
1496
|
+
end
|
794
1497
|
end
|
795
1498
|
|
796
1499
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -820,8 +1523,8 @@ module PlexRubySDK
|
|
820
1523
|
end
|
821
1524
|
|
822
1525
|
|
823
|
-
sig { params(rating_key: ::Float, include_elements: T.nilable(::String)).returns(::PlexRubySDK::Operations::GetMetadataChildrenResponse) }
|
824
|
-
def get_metadata_children(rating_key, include_elements = nil)
|
1526
|
+
sig { params(rating_key: ::Float, include_elements: T.nilable(::String), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetMetadataChildrenResponse) }
|
1527
|
+
def get_metadata_children(rating_key, include_elements = nil, timeout_ms = nil)
|
825
1528
|
# get_metadata_children - Get Items Children
|
826
1529
|
# This endpoint will return the children of of a library item specified with the ratingKey.
|
827
1530
|
#
|
@@ -843,11 +1546,61 @@ module PlexRubySDK
|
|
843
1546
|
headers['Accept'] = 'application/json'
|
844
1547
|
headers['user-agent'] = @sdk_configuration.user_agent
|
845
1548
|
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
1549
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
1550
|
+
|
1551
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1552
|
+
timeout ||= @sdk_configuration.timeout
|
1553
|
+
|
1554
|
+
connection = @sdk_configuration.client
|
1555
|
+
|
1556
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1557
|
+
base_url: base_url,
|
1558
|
+
oauth2_scopes: nil,
|
1559
|
+
operation_id: 'getMetadataChildren',
|
1560
|
+
security_source: @sdk_configuration.security_source
|
1561
|
+
)
|
1562
|
+
|
1563
|
+
error = T.let(nil, T.nilable(StandardError))
|
1564
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1565
|
+
|
1566
|
+
begin
|
1567
|
+
r = connection.get(url) do |req|
|
1568
|
+
req.headers.merge!(headers)
|
1569
|
+
req.options.timeout = timeout unless timeout.nil?
|
1570
|
+
req.params = query_params
|
1571
|
+
Utils.configure_request_security(req, security)
|
1572
|
+
|
1573
|
+
@sdk_configuration.hooks.before_request(
|
1574
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1575
|
+
hook_ctx: hook_ctx
|
1576
|
+
),
|
1577
|
+
request: req
|
1578
|
+
)
|
1579
|
+
end
|
1580
|
+
rescue StandardError => e
|
1581
|
+
error = e
|
1582
|
+
ensure
|
1583
|
+
if r.nil? || Utils.error_status?(r.status)
|
1584
|
+
r = @sdk_configuration.hooks.after_error(
|
1585
|
+
error: error,
|
1586
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1587
|
+
hook_ctx: hook_ctx
|
1588
|
+
),
|
1589
|
+
response: r
|
1590
|
+
)
|
1591
|
+
else
|
1592
|
+
r = @sdk_configuration.hooks.after_success(
|
1593
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1594
|
+
hook_ctx: hook_ctx
|
1595
|
+
),
|
1596
|
+
response: r
|
1597
|
+
)
|
1598
|
+
end
|
1599
|
+
|
1600
|
+
if r.nil?
|
1601
|
+
raise error if !error.nil?
|
1602
|
+
raise 'no response'
|
1603
|
+
end
|
851
1604
|
end
|
852
1605
|
|
853
1606
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -876,8 +1629,8 @@ module PlexRubySDK
|
|
876
1629
|
end
|
877
1630
|
|
878
1631
|
|
879
|
-
sig { params(type: ::PlexRubySDK::Operations::GetTopWatchedContentQueryParamType, include_guids: T.nilable(::Integer)).returns(::PlexRubySDK::Operations::GetTopWatchedContentResponse) }
|
880
|
-
def get_top_watched_content(type, include_guids = nil)
|
1632
|
+
sig { params(type: ::PlexRubySDK::Operations::GetTopWatchedContentQueryParamType, include_guids: T.nilable(::Integer), timeout_ms: T.nilable(Integer)).returns(::PlexRubySDK::Operations::GetTopWatchedContentResponse) }
|
1633
|
+
def get_top_watched_content(type, include_guids = nil, timeout_ms = nil)
|
881
1634
|
# get_top_watched_content - Get Top Watched Content
|
882
1635
|
# This endpoint will return the top watched content from libraries of a certain type
|
883
1636
|
#
|
@@ -894,75 +1647,81 @@ module PlexRubySDK
|
|
894
1647
|
headers['Accept'] = 'application/json'
|
895
1648
|
headers['user-agent'] = @sdk_configuration.user_agent
|
896
1649
|
|
897
|
-
|
898
|
-
req.headers = headers
|
899
|
-
req.params = query_params
|
900
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
901
|
-
Utils.configure_request_security(req, security) if !security.nil?
|
902
|
-
end
|
1650
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
903
1651
|
|
904
|
-
|
1652
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
1653
|
+
timeout ||= @sdk_configuration.timeout
|
905
1654
|
|
906
|
-
|
907
|
-
|
1655
|
+
connection = @sdk_configuration.client
|
1656
|
+
|
1657
|
+
hook_ctx = SDKHooks::HookContext.new(
|
1658
|
+
base_url: base_url,
|
1659
|
+
oauth2_scopes: nil,
|
1660
|
+
operation_id: 'getTopWatchedContent',
|
1661
|
+
security_source: @sdk_configuration.security_source
|
908
1662
|
)
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
1663
|
+
|
1664
|
+
error = T.let(nil, T.nilable(StandardError))
|
1665
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
1666
|
+
|
1667
|
+
begin
|
1668
|
+
r = connection.get(url) do |req|
|
1669
|
+
req.headers.merge!(headers)
|
1670
|
+
req.options.timeout = timeout unless timeout.nil?
|
1671
|
+
req.params = query_params
|
1672
|
+
Utils.configure_request_security(req, security)
|
1673
|
+
|
1674
|
+
@sdk_configuration.hooks.before_request(
|
1675
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
1676
|
+
hook_ctx: hook_ctx
|
1677
|
+
),
|
1678
|
+
request: req
|
1679
|
+
)
|
913
1680
|
end
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
1681
|
+
rescue StandardError => e
|
1682
|
+
error = e
|
1683
|
+
ensure
|
1684
|
+
if r.nil? || Utils.error_status?(r.status)
|
1685
|
+
r = @sdk_configuration.hooks.after_error(
|
1686
|
+
error: error,
|
1687
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
1688
|
+
hook_ctx: hook_ctx
|
1689
|
+
),
|
1690
|
+
response: r
|
1691
|
+
)
|
1692
|
+
else
|
1693
|
+
r = @sdk_configuration.hooks.after_success(
|
1694
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
1695
|
+
hook_ctx: hook_ctx
|
1696
|
+
),
|
1697
|
+
response: r
|
1698
|
+
)
|
918
1699
|
end
|
919
|
-
|
920
|
-
if
|
921
|
-
|
922
|
-
|
1700
|
+
|
1701
|
+
if r.nil?
|
1702
|
+
raise error if !error.nil?
|
1703
|
+
raise 'no response'
|
923
1704
|
end
|
924
1705
|
end
|
925
1706
|
|
926
|
-
res
|
927
|
-
end
|
928
|
-
|
929
|
-
|
930
|
-
sig { returns(::PlexRubySDK::Operations::GetOnDeckResponse) }
|
931
|
-
def get_on_deck
|
932
|
-
# get_on_deck - Get On Deck
|
933
|
-
# This endpoint will return the on deck content.
|
934
|
-
#
|
935
|
-
url, params = @sdk_configuration.get_server_details
|
936
|
-
base_url = Utils.template_url(url, params)
|
937
|
-
url = "#{base_url}/library/onDeck"
|
938
|
-
headers = {}
|
939
|
-
headers['Accept'] = 'application/json'
|
940
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
941
|
-
|
942
|
-
r = @sdk_configuration.client.get(url) do |req|
|
943
|
-
req.headers = headers
|
944
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
945
|
-
Utils.configure_request_security(req, security) if !security.nil?
|
946
|
-
end
|
947
|
-
|
948
1707
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
949
1708
|
|
950
|
-
res = ::PlexRubySDK::Operations::
|
1709
|
+
res = ::PlexRubySDK::Operations::GetTopWatchedContentResponse.new(
|
951
1710
|
status_code: r.status, content_type: content_type, raw_response: r
|
952
1711
|
)
|
953
1712
|
if r.status == 200
|
954
1713
|
if Utils.match_content_type(content_type, 'application/json')
|
955
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::
|
1714
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetTopWatchedContentResponseBody)
|
956
1715
|
res.object = out
|
957
1716
|
end
|
958
1717
|
elsif r.status == 400
|
959
1718
|
if Utils.match_content_type(content_type, 'application/json')
|
960
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::
|
1719
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetTopWatchedContentBadRequest)
|
961
1720
|
res.bad_request = out
|
962
1721
|
end
|
963
1722
|
elsif r.status == 401
|
964
1723
|
if Utils.match_content_type(content_type, 'application/json')
|
965
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::
|
1724
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::PlexRubySDK::Operations::GetTopWatchedContentUnauthorized)
|
966
1725
|
res.unauthorized = out
|
967
1726
|
end
|
968
1727
|
end
|